-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa5f4d7
commit 4234b88
Showing
2 changed files
with
73 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Delete stale images | ||
|
||
description: Delete stale images | ||
|
||
inputs: | ||
delay: | ||
description: Delay before running the action (in seconds) | ||
required: false | ||
default: "0" # seconds | ||
token: | ||
description: A Github PAT token to fetch repository and delete packages (needs delete:packages permissions). | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Delay # needed in case of retry to avoid triggering the rate limit of the Github API | ||
if: ${{ inputs.delay != '0' }} | ||
shell: bash | ||
run: | | ||
sleep ${{ inputs.delay }} | ||
- name: Delete older than a month vnext and vnext-pr images | ||
uses: snok/container-retention-policy@v2 | ||
with: | ||
image-names: iotivity-lite/* | ||
cut-off: One month ago UTC | ||
account-type: org | ||
org-name: iotivity | ||
filter-tags: vnext-* | ||
skip-tags: master | ||
token: ${{ inputs.token }} | ||
|
||
- name: Set up Docker Buildx for delete untagged images action | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry for delete untagged images action | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ inputs.token }} | ||
|
||
- name: Delete untagged images with no dependency | ||
uses: Chizkiyahu/delete-untagged-ghcr-action@v3 | ||
with: | ||
repository: ${{ github.repository }} | ||
repository_owner: ${{ github.repository_owner }} | ||
token: ${{ inputs.token }} | ||
owner_type: org | ||
untagged_only: true | ||
except_untagged_multiplatform: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters