Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e18a2c7

Browse files
committedAug 10, 2023
fix tag lookup
1 parent 232bed4 commit e18a2c7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎.github/workflows/pr-deploy.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,22 @@ jobs:
252252
- name: Check if image exists
253253
run: |
254254
set -euo pipefail
255-
foundTag=$(curl -fsSL https://github.com/coder/coder/pkgs/container/coder-preview | grep -o ${{ env.CODER_IMAGE_TAG }} | head -n 1)
255+
foundTag=$(
256+
gh api /orgs/coder/packages/container/coder-preview/versions |
257+
jq -r --arg tag "${{ env.CODER_IMAGE_TAG }}" '.[] |
258+
select(.metadata.container.tags == [$tag]) |
259+
.metadata.container.tags[0]'
260+
)
256261
if [ -z "$foundTag" ]; then
257262
echo "Image not found"
258263
echo "${{ env.CODER_IMAGE_TAG }} not found in ghcr.io/coder/coder-preview"
259264
exit 1
265+
else
266+
echo "Image found"
267+
echo "$foundTag tag found in ghcr.io/coder/coder-preview"
260268
fi
269+
env:
270+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
261271

262272
- name: Add DNS record to Cloudflare
263273
run: |

0 commit comments

Comments
 (0)
Failed to load comments.