Fork PR Secrets Access

lesson workflow active workflow/fork-pr-secrets.md View on GitHub

Fork PR Secrets Access

Rule

Secrets are not available to PRs from forks; push directly to the repo if you have member access.

Context

When CI fails on a PR due to missing secrets, and you're a member of the organization.

Detection

Observable signals:

Pattern

Check access and push directly:

# Check your permissions on the repo
gh api repos/ORG/REPO --jq '.permissions'
# If push: true → you can push directly

# Option 1: Push directly to the org repo
git remote add upstream git@github.com:ORG/REPO.git
git push upstream your-branch:your-branch

# Option 2: For existing fork-based PR with no push access
# Have maintainer cherry-pick your commits to a direct branch
# Or request push access

Why this happens:

If you don't have push access:

Outcome

Following this pattern results in:

Related

Match Keywords

CI secret not available fork PR failing CI secret not accessible via fork push directly to repo ANTHROPIC_API_KEY not set permission denied pushing to org repo