Skip to content

Commit 3f62dcb

Browse files
d-csclaude
andcommitted
ci: gate Helm chart prerelease publish behind a repository variable
The prerelease job pushes the packaged chart to oci://ghcr.io/<owner>/charts, which needs write_package on the owner's charts namespace. Forks and private mirrors that lack it fail this job (403 permission_denied) on every PR. Add an ENABLE_HELM_PRERELEASE gate, matching the pattern from #3901: the job runs unless the variable is explicitly 'false', so behaviour is unchanged where it's unset. The lint-and-test job (no push) always runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent af526de commit 3f62dcb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/helm-prerelease.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,15 @@ jobs:
6868

6969
prerelease:
7070
needs: lint-and-test
71+
# Set the ENABLE_HELM_PRERELEASE repository variable to 'false' to turn off
72+
# publishing the chart to GHCR — e.g. forks/mirrors that lack write_package
73+
# on the owner's charts namespace. Defaults to enabled; the lint-and-test
74+
# job above always runs regardless.
7175
if: |
72-
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
76+
vars.ENABLE_HELM_PRERELEASE != 'false' &&
77+
((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
7378
github.event_name == 'push' ||
74-
github.event_name == 'workflow_dispatch'
79+
github.event_name == 'workflow_dispatch')
7580
runs-on: ubuntu-latest
7681
permissions:
7782
contents: read

0 commit comments

Comments
 (0)