Skip to content

Commit

Permalink
docs: Add an example using GITHUB_TOKEN
Browse files Browse the repository at this point in the history
  • Loading branch information
Injabie3 authored and sondrelg committed Dec 7, 2023
1 parent 919ae1b commit 9505983
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,31 @@ jobs:
token: ${{ secrets.PAT }}
```
An example using `${{ secrets.GITHUB_TOKEN }}` in a repository with package name `my-package`:

```yaml
name: Delete old container images
on:
schedule:
- cron: '0 0 0 * *' # the first day of the month
jobs:
clean-ghcr:
name: Delete old unused container images
runs-on: ubuntu-latest
steps:
- name: Delete old images
uses: snok/container-retention-policy@v2
with:
image-names: my-package
cut-off: One month ago UTC
keep-at-least: 1
account-type: personal
token: ${{ secrets.GITHUB_TOKEN }}
token-type: github-token
```

# Parameters

## image-names
Expand Down Expand Up @@ -219,7 +244,7 @@ for more details.

* **Required**: `No`
* **Default**: `pat`
* **Example:**: `token: github-token`
* **Example**: `token: github-token`
* **Valid choices**: `github-token` or `pat`

The type of token being passed into `token`, which is used to authenticate to Github.
Expand Down

0 comments on commit 9505983

Please sign in to comment.