fix(ci): update image existence check to use GitHub token for authentication
Build & Test (NowChessSystems) TeamCity build finished

This commit is contained in:
2026-05-03 12:16:31 +02:00
parent d522f7f6ed
commit 327c23a6aa
+10 -1
View File
@@ -66,10 +66,19 @@ jobs:
- name: Check if image exists in GHCR
id: image-check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Exchange the GitHub token for a GHCR registry JWT
TOKEN=$(curl -s \
-u "${{ github.actor }}:${GH_TOKEN}" \
"https://ghcr.io/token?scope=repository:now-chess/now-chess-systems/${{ matrix.module }}:pull&service=ghcr.io" \
| jq -r .token)
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Authorization: Bearer ${TOKEN}" \
"https://ghcr.io/v2/now-chess/now-chess-systems/${{ matrix.module }}/manifests/${{ steps.version.outputs.version }}")
if [[ "$STATUS" == "200" ]]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else