Problem
The pull-request-target-checkout-false codemod heals the common case of on.pull_request_target + implicit checkout, but silently skips workflows that declare an explicit checkout: block, leaving them broken under --strict with no automated remediation and no diagnostic.
Today's cross-repo audit observed this error signature in 2 of 20 repositories — one auto-healed, one not:
| Repo |
Has explicit checkout:? |
gh aw fix result |
runhey/OnmyojiAutoScript |
No |
✅ healed (checkout: false added) |
Azure/azure-sdk-for-net |
Yes (sparse-checkout) |
❌ skipped → still fails |
Error
mgmt-review.md:1:1: error: pull_request_target trigger with checkout enabled is extremely insecure.
Why the codemod skips it
Per --list-codemods, pull-request-target-checkout-false is documented as:
Adds checkout: false to workflows using on.pull_request_target when checkout is not disabled and no explicit checkout command is detected.
Azure/azure-sdk-for-net's mgmt-review.md declares an explicit checkout:
on:
pull_request_target:
types: [opened, reopened, synchronize]
checkout:
sparse-checkout: |
.github
Because an explicit checkout: is present, the codemod (correctly) declines to flip it — auto-changing an intentional checkout could silently alter behaviour. But the result is a dead end: fix reports success while the workflow still fails to compile.
Proposal
This is hard to auto-fix safely (you can't blindly turn an intentional sparse-checkout into checkout: false), so the actionable improvement is diagnostic, not silent skip:
- When
gh aw fix encounters pull_request_target + an explicit checkout: block, emit an explicit, actionable message instead of skipping quietly — e.g.:
pull_request_target + explicit checkout: cannot be auto-remediated. Either switch to the pull_request trigger, or set checkout: false and add an explicit checkout of a trusted ref. The .github-only sparse checkout here is likely safe to convert to checkout: false.
- Optionally offer an opt-in transform (behind a flag/prompt) for the narrow, demonstrably-safe case where the sparse-checkout only touches
.github/** (no PR-controlled source), converting it to checkout: false.
Acceptance criteria
Representative repositories
Azure/azure-sdk-for-net — .github/workflows/mgmt-review.md (not healed)
runhey/OnmyojiAutoScript — .github/workflows/pr-review-*.md (healed, baseline for expected behaviour)
Source: daily [aw-compat] cross-repo compilation audit, build 85015b1.
Generated by 🔧 Daily AW Cross-Repo Compile Check · 259 AIC · ◷
Problem
The
pull-request-target-checkout-falsecodemod heals the common case ofon.pull_request_target+ implicit checkout, but silently skips workflows that declare an explicitcheckout:block, leaving them broken under--strictwith no automated remediation and no diagnostic.Today's cross-repo audit observed this error signature in 2 of 20 repositories — one auto-healed, one not:
checkout:?gh aw fixresultrunhey/OnmyojiAutoScriptcheckout: falseadded)Azure/azure-sdk-for-netsparse-checkout)Error
Why the codemod skips it
Per
--list-codemods,pull-request-target-checkout-falseis documented as:Azure/azure-sdk-for-net'smgmt-review.mddeclares an explicit checkout:Because an explicit
checkout:is present, the codemod (correctly) declines to flip it — auto-changing an intentional checkout could silently alter behaviour. But the result is a dead end:fixreports success while the workflow still fails to compile.Proposal
This is hard to auto-fix safely (you can't blindly turn an intentional
sparse-checkoutintocheckout: false), so the actionable improvement is diagnostic, not silent skip:gh aw fixencounterspull_request_target+ an explicitcheckout:block, emit an explicit, actionable message instead of skipping quietly — e.g.:.github/**(no PR-controlled source), converting it tocheckout: false.Acceptance criteria
gh aw fixno longer reports "fixed" for a workflow that remains broken on this pattern.pull_request_target+ explicit-checkout combination and links to the safe pattern..github-only sparse-checkout case.Representative repositories
Azure/azure-sdk-for-net—.github/workflows/mgmt-review.md(not healed)runhey/OnmyojiAutoScript—.github/workflows/pr-review-*.md(healed, baseline for expected behaviour)