Skip to content

Commit 38f4a8f

Browse files
committed
Better error handling and add missing FQDN
Signed-off-by: Samuel Monson <[email protected]>
1 parent 59c1be8 commit 38f4a8f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/container-maintenance.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
concurrency:
1010
group: ${{ github.workflow }}
1111

12+
permissions:
13+
packages: write
14+
1215
jobs:
1316
cleanup-container-tags:
1417
runs-on: ubuntu-latest
@@ -36,14 +39,15 @@ jobs:
3639
registry: ghcr.io/${{ github.repository_owner }}
3740
- name: Get list of tags
3841
run: |
39-
skopeo list-tags docker://${{ github.repository }} | jq --raw-output '.Tags[]' > tags
42+
set -euo pipefail # Fail pipe if any command fails
43+
skopeo list-tags docker://ghcr.io/${{ github.repository }} | jq --raw-output '.Tags[]' > tags
4044
- name: Get latest release and rc tags
4145
run: |
4246
STABLE_TAG="$(grep -P '^v\d+\.\d+\.\d+$' tags | sort -rV | head -n1)"
43-
echo "STABLE_TAG=${STABLE_TAG:-v0.0.0}" >> $GITHUB_ENV
47+
echo "stable_tag=${STABLE_TAG:-v0.0.0}" >> $GITHUB_ENV
4448
LATEST_TAG="$(grep -P '^v\d+\.\d+\.\d+' tags | sort -rV | head -n1)"
45-
echo "LATEST_TAG=${LATEST_TAG:-v0.0.0}" >> $GITHUB_ENV
49+
echo "latest_tag=${LATEST_TAG:-v0.0.0}" >> $GITHUB_ENV
4650
- name: Update latest and stable tags
4751
run: |
48-
skopeo copy docker://${{ github.repository }}:${{ env.stable_tag }} docker://${{ github.repository }}:stable
49-
skopeo copy docker://${{ github.repository }}:${{ env.latest_tag }} docker://${{ github.repository }}:latest
52+
skopeo copy docker://ghcr.io/${{ github.repository }}:${{ env.stable_tag }} docker://ghcr.io/${{ github.repository }}:stable
53+
skopeo copy docker://ghcr.io/${{ github.repository }}:${{ env.latest_tag }} docker://ghcr.io/${{ github.repository }}:latest

0 commit comments

Comments
 (0)