Skip to content

ci: use pull_request_target for fork PR secrets access - #56

Merged
jiahy0825 merged 1 commit into
mainfrom
fix/ci-fork-secrets
Aug 12, 2026
Merged

ci: use pull_request_target for fork PR secrets access#56
jiahy0825 merged 1 commit into
mainfrom
fix/ci-fork-secrets

Conversation

@cennn

@cennn cennn commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Switch integration_test.yml trigger from pull_request to pull_request_target so that fork PRs can access repository secrets (e.g. HTTP_PROXY, CCR_USERNAME/CCR_PASSWORD).

Why

With pull_request, GitHub does not inject secrets for fork PRs — even after maintainer approval. This causes CI to fail on any fork contribution.

pull_request_target runs the workflow YAML from the base branch (main), so:

  1. Fork authors cannot modify the workflow to steal secrets.
  2. Secrets are safely injected.
  3. _ci_pipeline.yml already checks out the PR commit via head-sha, so no other changes needed.

Security model

  • Layer 1 (existing): Fork PRs require maintainer approval before running.
  • Layer 2 (this change): Workflow YAML always comes from main — forks cannot alter it.

Test plan

  • Open a fork PR and verify CI runs with secrets available.
  • Verify internal (non-fork) PRs continue to work as before.

With pull_request, GitHub does not inject secrets for fork PRs (even
after maintainer approval). pull_request_target runs the workflow YAML
from the base branch so secrets are safely available. The _ci_pipeline
already checks out the PR commit via head-sha, so no other changes are
needed.

@jiahy0825 jiahy0825 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jiahy0825
jiahy0825 merged commit 84890c4 into main Aug 12, 2026
1 check passed
@jiahy0825
jiahy0825 deleted the fix/ci-fork-secrets branch August 12, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants