Skip to content

Commit

Permalink
Update image manifest retrieval in builder
Browse files Browse the repository at this point in the history
workflow
  • Loading branch information
Geczy committed Dec 25, 2023
1 parent bad88b7 commit f7b0d00
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ jobs:
steps:
- uses: actions/checkout@v4

# Encode GITHUB_TOKEN
- name: Encode GITHUB_TOKEN
run: echo "GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)" >> $GITHUB_ENV

# Step 1: Fetch current image manifests
- name: Fetch current manifests
run: |
IMAGES=("twitch-chat" "twitch-events" "steam" "dota")
for IMAGE in "${IMAGES[@]}"; do
MANIFEST=$(curl -H "Accept: application/vnd.oci.image.index.v1+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://ghcr.io/v2/dotabod/$IMAGE/manifests/v2.1")
MANIFEST=$(curl -s -H "Accept: application/vnd.oci.image.index.v1+json" -H "Authorization: Bearer ${{ secrets.GHA_READ_PKG }}" "https://ghcr.io/v2/dotabod/$IMAGE/manifests/v2.1")
echo "OLD_${IMAGE^^}_MANIFEST=$MANIFEST" >> $GITHUB_ENV
done
Expand Down Expand Up @@ -49,7 +45,7 @@ jobs:
run: |
UPDATED_IMAGES=""
for IMAGE in "${IMAGES[@]}"; do
NEW_MANIFEST=$(curl -H "Accept: application/vnd.oci.image.index.v1+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://ghcr.io/v2/dotabod/$IMAGE/manifests/v2.1")
NEW_MANIFEST=$(curl -H "Accept: application/vnd.oci.image.index.v1+json" -H "Authorization: Bearer ${{ secrets.GHA_READ_PKG }}" "https://ghcr.io/v2/dotabod/$IMAGE/manifests/v2.1")
OLD_MANIFEST_VAR="OLD_${IMAGE^^}_MANIFEST"
# Compare manifests (e.g., using digests or other relevant data)
if [ "$NEW_MANIFEST" != "${!OLD_MANIFEST_VAR}" ]; then
Expand Down

0 comments on commit f7b0d00

Please sign in to comment.