ci: skip privileged PR jobs on fork PRs (#3458)
Fork PRs can't access org secrets or push to GHCR, so these two `pull_request` jobs hard-fail with no path to passing: - `claude-md-audit` - needs `CLAUDE_CODE_OAUTH_TOKEN` - `helm-pr-prerelease` `prerelease` job - needs `packages: write` to push the chart Hit this on #3449. Approving the run didn't help; the jobs ran and failed at the privileged step. The chart-validation `lint-and-test` job is fork-safe and stays untouched - that remains the merge gate for Helm changes. Gate both jobs on same-repo head: ```yaml if: github.event.pull_request.head.repo.full_name == github.repository ``` Other PR workflows already handle forks fine: `pr_checks` (typecheck/units/e2e/sdk-compat) falls back to anonymous DockerHub pulls when secrets are missing.
This commit is contained in:
@@ -16,7 +16,9 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
audit:
|
||||
if: github.event.pull_request.draft == false
|
||||
if: >-
|
||||
github.event.pull_request.draft == false &&
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -54,6 +54,7 @@ jobs:
|
||||
|
||||
prerelease:
|
||||
needs: lint-and-test
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
Reference in New Issue
Block a user