Skip to content

Commit b9492eb

Browse files
committed
fix: update GitHub CLI usage for tag retrieval and correct token reference
1 parent 3521a3d commit b9492eb

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

.github/workflows/publish-alpha.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,22 @@ jobs:
3232

3333
- name: Clean install dependencies
3434
run: npm clean-install
35-
36-
- name: Set up GitHub CLI
37-
uses: cli/cli@v3
38-
35+
3936
- name: Determine next alpha version
4037
id: version
4138
env:
42-
GH_TOKEN: ${{ secrets.GHCR_PAT }}
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4340
run: |
4441
BASE_VERSION=$(node -p "require('./package.json').version")
4542
BASE_VERSION=$(echo "$BASE_VERSION" | sed 's/-.*//')
4643
IMAGE_NAME=ghcr.io/${{ github.repository }}/podverse-api
4744
48-
# Use GitHub CLI to get tags
45+
# Use gh CLI to list tags for the container image
4946
TAGS_JSON=$(gh api -H "Accept: application/vnd.github+json" \
50-
/orgs/${GITHUB_REPOSITORY%/*}/packages/container/podverse-api/versions)
47+
"/repos/${{ github.repository }}/packages/container/podverse-api/versions" \
48+
--jq '[.[] | .metadata.container.tags[]] | unique')
5149
echo "Raw tags JSON: $TAGS_JSON"
52-
TAGS=$(echo "$TAGS_JSON" | jq -r '.[].metadata.container.tags[]' | grep "alpha" || true)
50+
TAGS=$(echo "$TAGS_JSON" | jq -r '.[]' | grep "alpha" || true)
5351
echo "Filtered alpha tags: $TAGS"
5452
5553
# Try to get the current alpha version (e.g., 5.1.1-alpha.3)
@@ -90,4 +88,4 @@ jobs:
9088

9189
- name: Push Docker image
9290
run: |
93-
docker push ghcr.io/${{ github.repository }}/podverse-api:${{ steps.version.outputs.NEXT_VERSION }}
91+
docker push ghcr.io/${{ github.repository }}/podverse-api:${{ steps.version.outputs.NEXT_VERSION }}

0 commit comments

Comments
 (0)