Safe Output Health Report - 2026-02-21 #17389
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-02-28T04:24:45.044Z.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Executive Summary
Safe Output Job Statistics
safe_outputsupdate_cache_memoryupload_assetsunlockconfigreleaseError Clusters
Cluster 1: Git Branch Resolution Bug in
push_to_pull_request_branchsafe_outputsSample Error Message
The checkout step was invoked with
ref: 17284/merge(seewith:block), which is not a valid branch name.push_to_pull_request_branchhandler derives the branch name by stripping therefs/pull/prefix from the GITHUB_REF (refs/pull/17284/merge), producing17284/merge. This is not a real branch — it is a virtual merge ref GitHub creates for CI.refs/heads/17284/mergedoes not exist, causing theactions/checkoutfetch to fail with exit code 1 after three retries.mainas the target branch instead, bypassing the broken branch resolution.safe_outputsjob failures. Thepush_to_pull_request_branchsafe output was not executed; no code was pushed to the PR.Root Cause Analysis
Logic Error: PR Merge Ref Branch Derivation
When a workflow triggers on a
pull_requestevent,GITHUB_REFis set torefs/pull/(number)/merge. Thepush_to_pull_request_branchhandler appears to derive the target branch name by strippingrefs/pull/— yielding(number)/merge— rather than using the actual head branch name.The correct value is available via:
GITHUB_HEAD_REFenvironment variable (set forpull_requestevents, contains the actual head branch name)pull_request.head.reffield)The successful run #4 avoided this by the agent producing a different branch target (
main), not by a code fix.Agent Failures (Not Safe Output Issues — Informational Only)
The following failures caused
safe_outputsto be skipped (not failed). These are agent-level issues, not safe output job issues, and are out of scope for this audit but noted for completeness:GH_AW_GITHUB_TOKEN)Recommendations
Critical Issues (Immediate Action Required)
push_to_pull_request_branch— UseGITHUB_HEAD_REFfor Branch Resolutionrefs/pull/from merge ref, producingN/merge— not a real branchGITHUB_HEAD_REF(available as an env var onpull_requestevents) or fetch the head branch from the GitHub APIactions/safe-outputs/checkout_pr_branch.cjsoractions/safe-outputs/push_to_pull_request_branch.cjspull_requestthat producespush_to_pull_request_branchsafe outputsBug Fixes Required
push_to_pull_request_branchBranch Derivationactions/safe-outputs/push_to_pull_request_branch.cjs(or relatedcheckout_pr_branch.cjs)refpassed toactions/checkoutis17284/merge(derived fromrefs/pull/17284/mergeby strippingrefs/pull/)process.env.GITHUB_HEAD_REF(or equivalent) to obtain the actual PR head branch name when the trigger is a pull_request eventsmoke-multi-prworkflow on a PR to confirm branch checkout succeedsProcess Improvements
Add Integration Test for PR-Triggered
push_to_pull_request_branchsmoke-multi-pr) validates the overall flow but the branch resolution bug was not caught in code reviewcheckout_pr_branch.test.cjsverifying that whenGITHUB_REF=refs/pull/N/merge, the resolved branch isGITHUB_HEAD_REFnotN/mergeRetry Logic for
push_to_pull_request_branchBranch Not Found\d+/merge) and automatically fall back toGITHUB_HEAD_REFWork Item Plans
Work Item 1: Fix PR Merge Ref Branch Resolution in
push_to_pull_request_branchpush_to_pull_request_branchsafe output handler incorrectly derives branch names from PR merge refs (refs/pull/N/merge), producing invalid branch names (N/merge). This causesgit fetchto fail when any workflow triggered viapull_requestevent tries to push code back to the PR branch.push_to_pull_request_branchcorrectly identifies the PR head branch whenGITHUB_REFisrefs/pull/N/mergesmoke-multi-prpasses consistently when triggered on a pull_request eventcheckout_pr_branch.test.cjscovering the merge ref scenarioGITHUB_REFmatchesrefs/pull/\d+/mergepattern and useGITHUB_HEAD_REFinstead. Alternatively, query the GitHub API forpull_request.head.ref.Historical Context
No historical data available — this is the first Safe Output Health Monitor run. Cache memory has been initialized at
/tmp/gh-aw/cache-memory/safe-output-health/. Future audits will provide trend comparisons.Metrics and KPIs
update_cache_memory,unlock,config,release— 100% successsafe_outputs— 2 failures both from the same root causeNext Steps
push_to_pull_request_branchbranch resolution to useGITHUB_HEAD_REFsafe_outputssuccess rate returns to 100%References:
All reactions