Inputs
💡 Click on the Input Name for more Details.
| Input Name | Default Value | Short Description of the Input Value |
|---|---|---|
| token | Required | Cloudflare API Token |
| zones | Required | Zone Names to Purge |
| files | - | Files to Purge |
| prefix | - | Prefix Prepended to files |
| tags | - | Tags to Purge (Enterprise) |
| hosts | - | Hosts to Purge (Enterprise) |
| prefixes | - | Prefixes to Purge (Enterprise) |
| fail | all | Fail Mode: [all, any, none] |
| dry_run | false | Run Without Purging |
| summary | true | Add Summary to Job |
See the Examples section for more options.
Details
token Required
You need a Cloudflare Token with the permission Zone.Cache Purge.
zones Required
CSV or Newline Delimited list of zone names to purge.
View CSV and Newline Delimited Examples
CSV - Comma Seperated Value:
zones: cssnr.com,example.comNewline Delimited:
zones: |
cssnr.com
example.comfiles
CSV or Newline Delimited list of files to purge.
This is limited to 30 files on the free plan and 500 for enterprise. For more information view docs for purge by file.
prefix
If provided, the prefix will be prepended to all the files.
Useful for generating full links from file paths.
tags/hosts/prefixes Enterprise
List of tags , hosts , prefixes to purge, CSV or Newline Delimited.
For more information view docs for purge by tags, hostname, prefix.
fail
When purging multiple domains, set when the action should fail.
Options are all , any , none .
Default: all
dry_run
With this enabled it will only output the results and not purge any cache.
Default: false
summary
Write a Summary for the job. To disable this set to false.
Default: true
View Job Summary
⚠️ Only 1/2 Zones Purged!
⚠️ Dry Run! Remove or disable dry_run to purge cache.
Purge Results
| 🚽 | Zone |
|---|---|
| ✅ | cssnr.com |
| ⛔ | example.com |
Inputs
zones: cssnr.com,example.com
files:
prefix:
tags:
hosts:
prefixes:
fail: all
summary: true
dry_run: trueExamples
With minimal inputs, this will purge everything:
- name: 'Purge Cache Action'
uses: cssnr/cloudflare-purge-cache-action@v2
with:
token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
zones: cssnr.com,example.comTo limit what is purged, specify either files, tags, hosts, or prefixes.
With all inputs:
- name: 'Purge Cache Action'
uses: cssnr/cloudflare-purge-cache-action@v2
with:
token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
zones: cssnr.com
files: |
favicon.ico
static/logo.png
prefix: 'https://cssnr.com/'
tags: prod, dev
hosts: example.com, dev.example.com
prefixes: |
example.com
example.com/foo
fail: all
summary: true
dry_run: falseWorkflow Example.
name: 'Cloudflare Purge Cache'
on:
push:
jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Purge Cache Action'
uses: cssnr/cloudflare-purge-cache-action@v2
with:
token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
zones: |
cssnr.com
example.comFor more examples, you can check out other projects using this action:
https://github.com/cssnr/cloudflare-purge-cache-action/network/dependents
WARNING
These docs are not finished. Please see the README.md on GitHub.
