Allow publishers to retain every remote image tag
Fixes bug-bkhzrg4dzz00 Authored-By: Codex (GPT-6) <noreply@openai.com>
This commit is contained in:
@@ -31,6 +31,7 @@ local Docker daemon, image-push uploads it.
|
||||
| `org` | yes | — | Gitea org for package API (`fritzlab`, `dns`). |
|
||||
| `name` | yes | — | Package name as registered in the registry. |
|
||||
| `latest` | no | `true` | Also push a `:latest` tag. |
|
||||
| `prune` | no | `true` | Prune old numeric registry tags. Set `false` for retained or independently pinned artifacts. |
|
||||
| `keep` | no | `3` | Numeric tags to retain. Older are deleted. |
|
||||
|
||||
## Behavior
|
||||
@@ -38,6 +39,16 @@ local Docker daemon, image-push uploads it.
|
||||
1. `docker login code.fritzlab.net` as `ci-bot`.
|
||||
2. `docker push <image>:<tag>`.
|
||||
3. If `latest=true`, also `docker push <image>:latest`.
|
||||
4. Prune: list numeric tags from Gitea package API, keep the newest `keep`,
|
||||
4. If `prune=true`, list numeric tags from Gitea package API, keep the newest `keep`,
|
||||
delete the rest. Failures here do not fail the workflow
|
||||
(`continue-on-error: true`).
|
||||
|
||||
`prune` accepts only the strings `true` and `false`; invalid input fails before
|
||||
registry login or push. With `false`, remote package listing and deletion are
|
||||
skipped. Image upload and local Docker cleanup remain unchanged. The action does
|
||||
not discover deployment pins; owners choosing pruning must account for that
|
||||
retention contract.
|
||||
|
||||
Run `python3 -m unittest discover -s tests` with the pinned test dependencies in
|
||||
`tests/requirements.txt`. Tests inspect the composite action and execute only
|
||||
its credential-free validation step; no registry or package deletion runs.
|
||||
|
||||
Reference in New Issue
Block a user