Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for single URL purging #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ A GitHub Actions to purge Fastly cache.

## Usage

### Puge by surrogate key

```yaml
- name: Purge Fastly cache
uses: yukukotani/fastly-purge-action@v1
Expand All @@ -15,6 +17,18 @@ A GitHub Actions to purge Fastly cache.
soft: true
```

### Purge by single url

```yaml
- name: Purge Fastly cache
uses: yukukotani/fastly-purge-action@v1
with:
api-token: YOUR_TOKEN_HERE
target: single-url
url: "https://example.com/some/page"
soft: true
```

## Options

### api-token
Expand All @@ -23,24 +37,28 @@ A GitHub Actions to purge Fastly cache.

Your API token of Fastly. See [here](https://developer.fastly.com/reference/api/#authentication) for details.

### service-id
### target

**Required**

Your service id to purge caches. **This is not service name. This will be a random alphanumeric string.**
The target to purge. Currently, only `surrogate-key` and `single-url` are supported. `all` will be supported if anyone requests.

### target
### service-id

**Required**
**Required when the target is `surrogate-key`**

The target to purge. Currently, only `surrogate-key` is supported. `all` and `url` will be supported if anyone requests.
Your service id to purge caches. **This is not service name. This will be a random alphanumeric string.**

### keys

**Required when the target is `surrogate-key`**

Surrogate Keys to purge.

### url

**Required when the target is `single-url`**

### soft

True by default. If false, the affected object will be inaccessible rather than marked as stale.
14 changes: 10 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ inputs:
required: true
description: "API token of Fastly"
service-id:
required: true
description: "Service ID to purge"
required: false
description: "Service ID to purge. Required for `surrogate-key` target."
default: ""
soft:
description: "If false, the affected object will be inaccessible rather than marked as stale."
default: true
target:
required: true
description: "Target to purge. Currently only `surrogate-key` is supported."
description: "Target to purge. Currently only `surrogate-key` and `single-url` are supported."
keys:
required: true
required: false
description: "Surrogate keys to delete. Required if the target is `surrogate-key`."
default: []
url:
required: false
description: "Cached URL to purge. Required if the target is `single-url`."
default: ""
debug:
description: "debug key"
default: false
Expand Down
Loading