You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had a report that gh-aw doesn't work well in forks.
This is likely a lot of work and the first step will be to assess what works and what doesn't and give good errors or warnings if you add workflows to forks that use features that are known not to work well.
This report analyzes what works and what doesn't when gh-aw is used in forked repositories. There are two distinct fork scenarios that need to be addressed separately, with different failure modes and mitigation strategies. Several areas already have good handling; others need new errors/warnings.
Click to expand detailed findings
Research Findings
Two Distinct Fork Scenarios
Scenario A β Fork PRs into a gh-aw repo (inbound)
This scenario is already well-handled by the compiler:
pull_request triggers block all fork PRs by default (github.event.pull_request.head.repo.id == github.repository_id check injected)
forks: frontmatter field allows explicit allow-listing of trusted forks
push-to-pull-request-branch safe-output already has a fork check with a clear error: "Cannot push to fork PR: ... The workflow token does not have permission to push to fork repositories."
workflow_run triggers have !(github.event.workflow_run.repository.fork) injected by the compiler
Scenario B β Running gh-aw workflows inside a forked repository (fork-internal)
This is the unhandled case mentioned in the issue. When a user forks a repo that has gh-aw installed and tries to use those workflows in their own fork, multiple things break without clear errors:
Specific Features That Break in Forks
1. Secrets / API Keys β Silent Failures
Forked repos do not inherit secrets from the parent. All of these will be missing:
ANTHROPIC_API_KEY, OPENAI_API_KEY β the AI model cannot run at all
The current validate_secrets.cjs step in agentics-maintenance will report all these as missing, but without any indication that the fork context is the likely cause.
2. Agentic Maintenance Workflow (agentics-maintenance.yml) β Noisy and Confusing
This schedule-based workflow is automatically copied to all forks. In forks it will:
Run every 2 hours on schedule
Attempt to validate secrets (all fail)
Attempt to compile workflows (may fail without AI key)
Attempt to close expired issues/discussions/PRs (may silently no-op or fail)
There is currently no fork detection or graceful skip path in this workflow.
3. Slash Command Triggers β Broken Without Explanation
Issue comment-based /command triggers will fire on the fork's own issues/PRs, but the workflow will fail silently or with generic errors when the AI model can't start due to missing API keys. There is no user-facing message explaining the fork context.
4. gh aw init β No Fork Guidance
The init command doesn't detect fork context and gives no guidance about the different secret setup requirements for forks. A fork user running gh aw init gets the same instructions as a fresh install, with no indication they also need to configure their own copies of all the secrets.
5. Error Messages β Missing Fork Context
When workflows fail due to missing secrets in a fork, current errors say things like "API key not found" or "token not configured" β with no mention of fork context as a likely cause. This makes debugging very difficult for users who don't know what a fork implies for secrets.
6. workflow_run-based Triggers β Fork Safety Check Present, But Error Not User-Friendly
The workflow_run compiler already injects !(github.event.workflow_run.repository.fork) which prevents cross-fork triggering. The safety check itself is good, but if a fork user wonders why their workflow_run workflow never fires, there's no clear explanation.
What Currently Works in Forks
Feature
Status
Notes
pull_request fork filtering
β Already handled
Compiler injects repo ID check; forks: field for allow-listing
push-to-pull-request-branch fork check
β Already handled
Clear error message
workflow_run cross-fork safety
β Already handled
Fork check injected at compile time
Fork repo running its own workflows
β οΈ Partially works
Only if fork owner configures their own secrets
Agentic maintenance in fork
β Broken
No fork detection, runs without proper config
Slash commands in fork
β Broken
Fails silently without fork context in error
gh aw init in fork
β No guidance
No fork detection, no guidance on secret setup
Error messages in fork context
β No fork context
Generic errors, no fork cause explanation
Platform Constraints (GitHub Actions)
From GitHub's documentation:
Fork PRs use a read-only GITHUB_TOKEN with no access to parent secrets (unless repo explicitly enables "Send secrets to workflows from pull requests")
Forked repos don't inherit Actions secrets β the fork owner must configure their own secrets
pull_request_target event runs in the base repo context with full secret access β this is an alternative pattern for safe fork PR handling that could be relevant for some gh-aw workflows
Cache access from forks to the base repo is a known security consideration
Recommendations
Compile-time fork detection: gh aw compile (and gh aw init) should detect when running inside a forked repository (check gh repo view --json isFork) and emit warnings listing which secrets need to be configured and which features are restricted.
Fork-aware error messages: When a workflow fails because secrets are missing, add a check for github.event.repository.fork == true context. Include a fork-specific hint in the failure issue/comment generated by the conclusion job.
Agentic maintenance workflow β fork skip: Add a step at the start of agentics-maintenance.yml that checks if the current repository is a fork and skips with an info message rather than running and failing.
Fork documentation page: A dedicated page explaining: what works in forks, what doesn't, how to set up your own secrets, and when to use forks: vs pull_request_target.
validate_secrets fork context: In validate_secrets.cjs, detect the fork context (check context.payload.repository.fork) and prefix the report with a warning that all secrets must be reconfigured in the fork.
Consider pull_request_target guidance: For workflows that need to react to fork PRs with write access (e.g., auto-labeling, auto-commenting), document and provide an example using pull_request_target which runs in the base repo context.
Activity
dsyme commentedon Feb 26, 2026
/scout Please do the analysis mentioned
github-actions commentedon Feb 26, 2026
π Scout Research Report
Triggered by @dsyme
Executive Summary
This report analyzes what works and what doesn't when gh-aw is used in forked repositories. There are two distinct fork scenarios that need to be addressed separately, with different failure modes and mitigation strategies. Several areas already have good handling; others need new errors/warnings.
Click to expand detailed findings
Research Findings
Two Distinct Fork Scenarios
Scenario A β Fork PRs into a gh-aw repo (inbound)
This scenario is already well-handled by the compiler:
pull_requesttriggers block all fork PRs by default (github.event.pull_request.head.repo.id == github.repository_idcheck injected)forks:frontmatter field allows explicit allow-listing of trusted forkspush-to-pull-request-branchsafe-output already has a fork check with a clear error: "Cannot push to fork PR: ... The workflow token does not have permission to push to fork repositories."workflow_runtriggers have!(github.event.workflow_run.repository.fork)injected by the compilerScenario B β Running gh-aw workflows inside a forked repository (fork-internal)
This is the unhandled case mentioned in the issue. When a user forks a repo that has gh-aw installed and tries to use those workflows in their own fork, multiple things break without clear errors:
Specific Features That Break in Forks
1. Secrets / API Keys β Silent Failures
Forked repos do not inherit secrets from the parent. All of these will be missing:
ANTHROPIC_API_KEY,OPENAI_API_KEYβ the AI model cannot run at allGH_AW_GITHUB_TOKEN,GH_AW_COPILOT_TOKEN,GH_AW_GITHUB_MCP_SERVER_TOKENβ GitHub API/MCP access degradedThe current
validate_secrets.cjsstep inagentics-maintenancewill report all these as missing, but without any indication that the fork context is the likely cause.2. Agentic Maintenance Workflow (
agentics-maintenance.yml) β Noisy and ConfusingThis schedule-based workflow is automatically copied to all forks. In forks it will:
There is currently no fork detection or graceful skip path in this workflow.
3. Slash Command Triggers β Broken Without Explanation
Issue comment-based
/commandtriggers will fire on the fork's own issues/PRs, but the workflow will fail silently or with generic errors when the AI model can't start due to missing API keys. There is no user-facing message explaining the fork context.4.
gh aw initβ No Fork GuidanceThe init command doesn't detect fork context and gives no guidance about the different secret setup requirements for forks. A fork user running
gh aw initgets the same instructions as a fresh install, with no indication they also need to configure their own copies of all the secrets.5. Error Messages β Missing Fork Context
When workflows fail due to missing secrets in a fork, current errors say things like "API key not found" or "token not configured" β with no mention of fork context as a likely cause. This makes debugging very difficult for users who don't know what a fork implies for secrets.
6.
workflow_run-based Triggers β Fork Safety Check Present, But Error Not User-FriendlyThe
workflow_runcompiler already injects!(github.event.workflow_run.repository.fork)which prevents cross-fork triggering. The safety check itself is good, but if a fork user wonders why theirworkflow_runworkflow never fires, there's no clear explanation.What Currently Works in Forks
pull_requestfork filteringforks:field for allow-listingpush-to-pull-request-branchfork checkworkflow_runcross-fork safetygh aw initin forkPlatform Constraints (GitHub Actions)
From GitHub's documentation:
GITHUB_TOKENwith no access to parent secrets (unless repo explicitly enables "Send secrets to workflows from pull requests")pull_request_targetevent runs in the base repo context with full secret access β this is an alternative pattern for safe fork PR handling that could be relevant for some gh-aw workflowsRecommendations
Compile-time fork detection:
gh aw compile(andgh aw init) should detect when running inside a forked repository (checkgh repo view --json isFork) and emit warnings listing which secrets need to be configured and which features are restricted.Fork-aware error messages: When a workflow fails because secrets are missing, add a check for
github.event.repository.fork == truecontext. Include a fork-specific hint in the failure issue/comment generated by the conclusion job.Agentic maintenance workflow β fork skip: Add a step at the start of
agentics-maintenance.ymlthat checks if the current repository is a fork and skips with an info message rather than running and failing.Fork documentation page: A dedicated page explaining: what works in forks, what doesn't, how to set up your own secrets, and when to use
forks:vspull_request_target.validate_secretsfork context: Invalidate_secrets.cjs, detect the fork context (checkcontext.payload.repository.fork) and prefix the report with a warning that all secrets must be reconfigured in the fork.Consider
pull_request_targetguidance: For workflows that need to react to fork PRs with write access (e.g., auto-labeling, auto-commenting), document and provide an example usingpull_request_targetwhich runs in the base repo context.Key Sources
pull_request_targetevent and fork settingspkg/workflow/filters.goβ existing fork filter implementationactions/setup/js/push_to_pull_request_branch.cjsβ existing fork check patternpkg/workflow/workflow_run_repo_safety_test.goβworkflow_runfork safety checksSuggested Next Steps
gh aw init/gh aw compileCLI commands with a warning message listing required secretsagentics-maintenance.ymlthat gracefully skips with an info messagevalidate_secrets.cjsand the conclusion job failure reporter to include fork context ifcontext.payload.repository.fork === truepull_request_targetshould be added as a supported trigger type in the compiler with appropriate security warningsReferences:
pelikhan commentedon Feb 26, 2026
we need to maintain a fork and run agentic workflows in there
pelikhan commentedon Feb 26, 2026
it's the only way to ensure this feature works.
pelikhan commentedon Feb 26, 2026
/plan
gh aw init#18518validate_secrets.cjs#18519Add fork context hint to workflow failure conclusion messages
Add fork detection and warning to gh aw init (#18481)
Add fork context hint to workflow failure conclusion messages (#18529)
Add fork support documentation page (#18481)"
docs: Add fork support reference page (#18537)
Add GitHub Actions workflow to run evaluate-pr-tests via Copilot CLI (#β¦
Add GitHub Actions workflow to run evaluate-pr-tests via Copilot CLI (dβ¦
Add GitHub Actions workflow to run evaluate-pr-tests via Copilot CLI (dβ¦
Improve evaluate-pr-tests workflow: slash_command + workflow_dispatchβ¦