Repository navigation
Description
Problem
TestWorkflowSHAUsesAreTrusted (internal/scaffold/pr_trigger_test.go) fails on main at e2bf219, so test is red on every PR and merge-queue entry.
--- FAIL: TestWorkflowSHAUsesAreTrusted/.github/workflows/reusable-dispatch.yml
pr_trigger_test.go:150: ... should not contain "job.workflow_sha"
Messages: job.workflow_sha must be read through the trusted expression: if encoded="$(gh api "repos/${{ job.workflow_repository }}/contents/.github/scripts/report-agent-startup-failure.sh?ref=${{ job.workflow_sha }}" --jq .content)"; then
--- FAIL: TestWorkflowSHAUsesAreTrusted/.github/workflows/reusable-prioritize.yml
Cause
The two PRs merged one after the other, and each was green alone:
- fix(dispatch)!: move the shim from pull_request_target to pull_request #9230 added the test. It requires every
${{ ... job.workflow_sha ... }}read to go through the trusted expression. - fix(actions): report failures before the agent starts #9206 (by csoceanu) then added a fallback that fetches
report-agent-startup-failure.shwith a bare?ref=${{ job.workflow_sha }}.
The trusted expression is the one every checkout ref and CLI version input already uses:
(github.event_name == 'pull_request' && job.workflow_sha == github.sha && github.event.pull_request.base.sha || job.workflow_sha)
On a same-repo pull_request run of fullsend's own workflows, job.workflow_sha is the PR's merge commit (github.sha). The bare read therefore runs the failure reporter from the PR's code, not from the base branch.
The nine lines with the bare read are all if encoded="$(gh api ".../report-agent-startup-failure.sh?ref=${{ job.workflow_sha }}" --jq .content)"; then:
.github/workflows/reusable-dispatch.yml: 1653, 1828, 2044, 2352, 2505, 2636, 2835, 3106.github/workflows/reusable-prioritize.yml: 243
Fix
In those nine lines, replace ${{ job.workflow_sha }} with ${{ (github.event_name == 'pull_request' && job.workflow_sha == github.sha && github.event.pull_request.base.sha || job.workflow_sha) }}, matching the checkout refs.
Scope for the code agent
Nothing under .github/workflows/. The workflow edits follow in the same PR after a maintainer takes it over.
- Improve the failure message in
TestWorkflowSHAUsesAreTrusted: name the workflow file and the 1-based line number, so the next failure points at the exact line. - Keep the test's rule unchanged.
Done when
go test ./internal/scaffold/...passes on the PR, andtestis green.- No
${{ job.workflow_sha }}read in either reusable workflow bypasses the trusted expression.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
waynesun09 commentedon Nov 19, 2026
/fs-code
Do not sign off. No
git commit -s, noSigned-off-bytrailer.fullsend-ai-triage commentedon Nov 19, 2026
🤖 Finished Triage · ✅ Success · Started 9:57 PM UTC · Completed 9:59 PM UTC
Commit:
e2bf219· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.17
fullsend-ai-coder commentedon Nov 19, 2026
🤖 Code · ❌ Terminated · Started 9:58 PM UTC · Ended 10:08 PM UTC
Commit:
e2bf219· View workflow run →fullsend-ai-triage commentedon Nov 19, 2026
Triage confirmed the report against main at e2bf219. The nine bare
job.workflow_shareads sit at the lines listed in the issue, and the test's rule is as described.Warning: workflow changes required. The core fix edits files under
.github/workflows/. The code agent cannot modify those files under current permissions, so a maintainer or human PR has to make that edit. Until thenteststays red.Code-agent scope (no workflow edits): improve the
TestWorkflowSHAUsesAreTrustedfailure message ininternal/scaffold/pr_trigger_test.goso it names the workflow file and the 1-based line number. The rule stays unchanged.No open PR addresses this issue yet.
Proposed test case:
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancefullsend-ai-coder commentedon Nov 19, 2026
🤖 Finished Code · ✅ Success · Started 9:58 PM UTC · Completed 10:08 PM UTC
Commit:
e2bf219· View workflow run →Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $0.80
fix(workflows): read job.workflow_sha through the trusted expression …
test(fullsend-ai#9720): name file and line in workflow_sha trust fail…