Skip to content

Commit

Permalink
Renamed exclude-tags to not-delete-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ManiMatter committed Aug 11, 2024
1 parent 5b36f85 commit 11463fd
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ jobs:
and keeps untagged'
folder: '3a_single-keep-n-tagged'
keep-n-tagged: 2
exclude-tags: dummy
not-delete-tags: dummy

- title: '3b - Multi: Keep N Tagged'
purpose:
'Removes all tags except the newest 2 tagged images (multi arch)
and keeps untagged'
folder: '3b_multi-keep-n-tagged'
keep-n-tagged: 2
exclude-tags: dummy
not-delete-tags: dummy

- title: '4a - Single: Keep N Untagged'
purpose:
Expand Down Expand Up @@ -145,9 +145,9 @@ jobs:
KEEP_N_UNTAGGED="${{ matrix.tests.keep-n-untagged }}"
fi
EXCLUDE_TAGS=""
if [ ! -z "${{ matrix.tests.exclude-tags }}" ]; then
EXCLUDE_TAGS="${{ matrix.tests.exclude-tags }}"
NOT_DELETE_TAGS=""
if [ ! -z "${{ matrix.tests.not-delete-tags }}" ]; then
NOT_DELETE_TAGS="${{ matrix.tests.not-delete-tags }}"
fi
DRY_RUN=""
Expand All @@ -168,7 +168,7 @@ jobs:
echo "TAGS=$TAGS" >> $GITHUB_ENV
echo "KEEP_N_TAGGED=$KEEP_N_TAGGED" >> $GITHUB_ENV
echo "KEEP_N_UNTAGGED=$KEEP_N_UNTAGGED" >> $GITHUB_ENV
echo "EXCLUDE_TAGS=$EXCLUDE_TAGS" >> $GITHUB_ENV
echo "NOT_DELETE_TAGS=$NOT_DELETE_TAGS" >> $GITHUB_ENV
echo "DRY_RUN=$DRY_RUN" >> $GITHUB_ENV
echo "DELAY=$DELAY" >> $GITHUB_ENV
Expand All @@ -177,15 +177,15 @@ jobs:
# echo "tags: ${{ matrix.tests.tags }}"
# echo "keep-n-tagged: ${{ matrix.tests.keep-n-tagged }}"
# echo "keep-n-untagged: ${{ matrix.tests.keep-n-untagged }}"
# echo "exclude-tags: ${{ matrix.tests.exclude-tags }}"
# echo "not-delete-tags: ${{ matrix.tests.not-delete-tags }}"
# echo "dry-run: ${{ matrix.tests.dry-run }}"

# - name: ' > Debug: Print Env Variables'
# run: |
# echo "tags: ${{ env.TAGS }}"
# echo "keep-n-tagged: ${{ env.KEEP_N_TAGGED }}"
# echo "keep-n-untagged: ${{ env.KEEP_N_UNTAGGED }}"
# echo "exclude-tags: ${{ env.EXCLUDE_TAGS }}"
# echo "not-delete-tags: ${{ env.NOT_DELETE_TAGS }}"
# echo "dry-run: ${{ env.DRY_RUN }}"

- name: ' > Priming Test Environment'
Expand All @@ -200,7 +200,7 @@ jobs:
tags: ${{ env.TAGS }}
keep-n-tagged: ${{ env.KEEP_N_TAGGED }}
keep-n-untagged: ${{ env.KEEP_N_UNTAGGED }}
exclude-tags: ${{ env.EXCLUDE_TAGS }}
not-delete-tags: ${{ env.NOT_DELETE_TAGS }}
dry-run: ${{ env.DRY_RUN }}
token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ensure it's permissions have been setup correctly, either by:
|-------------------------|:--------:|----------|-------------------------------------------------------------------------------------------------------|
| tags | no | | Comma separated list of tags to delete (supports wildcard syntax) |
| delete-tags | no | | Same as tags |
| exclude-tags | no | | Comma separated list of tags to exclude (supports wildcard syntax) |
| not-delete-tags | no | | Tags strictly to be preserved / excluded from deletion (comma seperated). Supports wildcards |
| keep-n-untagged | no | | Number of untagged images to keep, sorted by date |
| keep-n-tagged | no | | Number of tagged images to keep, sorted by date |
| delete-untagged | no | depends* | Delete untagged images (not belonging to multi-arch containers) |
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
### Keep 'n' tagged images cleanup (keep-n-tagged)
Keeps a number (keep-n-tagged) of tagged images and then deletes the rest. Tags
are sorted by date. Additional exclude-tags values are not include the total
are sorted by date. Additional not-delete-tags values are not include the total
count.
```yaml
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
### Tag Wildcard
The tags and exclude-tags options can use a wildcard syntax, using the ?, \* and
The tags and not-delete-tags options can use a wildcard syntax, using the ?, \* and
\*\* characters. (Utilizes the wildcard-match library)
```yaml
Expand All @@ -224,7 +224,7 @@ jobs:
- uses: dataaxiom/ghcr-cleanup-action@v1
with:
keep-n-tagged: 3
exclude-tags: 'v*,dev,latest'
not-delete-tags: 'v*,dev,latest'
token: ${{ secrets.GITHUB_TOKEN }}
```
Expand All @@ -241,7 +241,7 @@ jobs:
uses: dataaxiom/ghcr-cleanup-action@v1
with:
keep-n-tagged: 10
exclude-tags: dev
not-delete-tags: dev
dry-run: true
token: ${{ secrets.GITHUB_TOKEN }}
```
Expand Down
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ inputs:
Tags to delete (comma seperated)
required: false

exclude-tags:
not-delete-tags:
description: >
Tags to exclude from deletion (comma seperated)
Tags strictly to be preserved / excluded from deletion (comma seperated)
Suports wildcards
required: false

keep-n-untagged:
Expand Down
2 changes: 1 addition & 1 deletion citester/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35295,7 +35295,7 @@ function getConfig() {
else if (core.getInput('delete-tags')) {
config.tags = core.getInput('delete-tags');
}
config.excludeTags = core.getInput('exclude-tags');
config.excludeTags = core.getInput('not-delete-tags');
if (core.getInput('keep-n-untagged')) {
if (isNaN(parseInt(core.getInput('keep-n-untagged')))) {
throw new Error('keep-n-untagged is not number');
Expand Down
2 changes: 1 addition & 1 deletion citester/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34391,7 +34391,7 @@ function getConfig() {
else if (core.getInput('delete-tags')) {
config.tags = core.getInput('delete-tags');
}
config.excludeTags = core.getInput('exclude-tags');
config.excludeTags = core.getInput('not-delete-tags');
if (core.getInput('keep-n-untagged')) {
if (isNaN(parseInt(core.getInput('keep-n-untagged')))) {
throw new Error('keep-n-untagged is not number');
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function getConfig(): Config {
config.tags = core.getInput('delete-tags')
}

config.excludeTags = core.getInput('exclude-tags')
config.excludeTags = core.getInput('not-delete-tags')

if (core.getInput('keep-n-untagged')) {
if (isNaN(parseInt(core.getInput('keep-n-untagged')))) {
Expand Down

0 comments on commit 11463fd

Please sign in to comment.