Skip to content

Commit 62914db

Browse files
clubandersonclaude
andauthored
🐛 fix: revert GHCR auth to PAT-based secrets (#699)
PR #698 switched from secrets.GHCR_TOKEN / secrets.CR_TOKEN to github.token for GHCR push. This broke releases because the GHCR package doesn't grant the repo's GITHUB_TOKEN write access. Revert Docker and Helm registry auth to the PAT-based secrets (GHCR_TOKEN, CR_TOKEN, CR_USER) that were working before. OCI labels in the Dockerfile are kept. Signed-off-by: Andrew Anderson <andy@clubanderson.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent da57ae7 commit 62914db

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

.github/workflows/ci-release.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
release:
88
types: [published] # Also runs when a GitHub release is published
99

10-
permissions:
11-
contents: read
12-
packages: write
13-
1410
jobs:
1511
docker-build-and-push:
1612
runs-on: ubuntu-latest
@@ -46,11 +42,7 @@ jobs:
4642
uses: docker/setup-buildx-action@v3
4743

4844
- name: Log in to GitHub Container Registry
49-
uses: docker/login-action@v3
50-
with:
51-
registry: ghcr.io
52-
username: ${{ github.actor }}
53-
password: ${{ github.token }}
45+
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
5446

5547
- name: Build and push multi-arch image
5648
run: |

.github/workflows/helm-release.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ jobs:
7070
# 4. Log in to GHCR for Docker push
7171
# -----------------------------------------
7272
- name: Docker login GHCR
73-
uses: docker/login-action@v3
74-
with:
75-
registry: ghcr.io
76-
username: ${{ github.actor }}
77-
password: ${{ github.token }}
73+
run: echo "${{ secrets.CR_TOKEN }}" | docker login ghcr.io -u ${{ secrets.CR_USER }} --password-stdin
7874

7975
# -----------------------------------------
8076
# 5. Build and push multi-arch Docker image
@@ -125,10 +121,12 @@ jobs:
125121
# 8. Login to GHCR for chart publishing
126122
# -----------------------------------------
127123
- name: Login to GHCR (Helm)
124+
env:
125+
GITHUB_TOKEN: ${{ secrets.CR_TOKEN }}
128126
run: |
129127
helm registry login ghcr.io \
130-
--username ${{ github.actor }} \
131-
--password "${{ github.token }}"
128+
--username ${{ secrets.CR_USER }} \
129+
--password "$GITHUB_TOKEN"
132130
echo "Helm registry login successful"
133131
134132
# -----------------------------------------
@@ -142,6 +140,8 @@ jobs:
142140
# 10. Push chart to GHCR
143141
# -----------------------------------------
144142
- name: Push Helm chart
143+
env:
144+
GITHUB_TOKEN: ${{ secrets.CR_TOKEN }}
145145
run: |
146146
VERSION="${{ steps.version.outputs.version }}"
147147
CHART_FILE="workload-variant-autoscaler-${VERSION}.tgz"

0 commit comments

Comments
 (0)