Skip to content

Trusted workflow-sha expression does not cover pull_request_review or the Jira poll workflow #9723

Open

Description

@waynesun09

Problem

The trusted workflow-sha expression only covers pull_request:

(github.event_name == 'pull_request' && job.workflow_sha == github.sha && github.event.pull_request.base.sha || job.workflow_sha)

It has two gaps:

  1. pull_request_review. The per-repo shim also triggers on pull_request_review (internal/scaffold/fullsend-repo/templates/shim-per-repo.yaml). That event runs from the PR merge ref, so github.sha is the merge commit. On a same-repo review event where the reusable workflow comes from the same repository (fullsend's own repo, or a vendored install), job.workflow_sha can therefore be the PR's merge commit. The expression then returns it unchanged. This affects every checkout, CLI-version and reporter-fetch line that uses the expression in reusable-dispatch.yml and reusable-prioritize.yml. Fork PRs are skipped by the dispatch guard, so only same-repo authors reach it.
  2. reusable-poll-jira.yml. It reads job.workflow_sha directly at the ref: (line 85) and workflow_sha: (line 98) inputs. TestWorkflowSHAUsesAreTrusted checks only the dispatch and prioritize workflows. Today the Jira poll is only called on schedule or workflow_dispatch, so no PR code reaches it.

Neither gap was introduced by #9721, which fixed the reporter-fetch lines to match the existing expression.

To decide

  • Review events. First confirm on a test repository what job.workflow_sha and github.sha are on a same-repo pull_request_review run. If they match the PR merge commit, extend the predicate to (github.event_name == 'pull_request' || github.event_name == 'pull_request_review'), in one change across all lines and the test constant.
  • The Jira poll. Either add reusable-poll-jira.yml to the test's file list, using the trusted expression, or record in the test why it is exempt.

Done when

  • Each case above is either covered by the trusted expression and the test, or documented as exempt with the reason.

Relates to #9720, #9721, #9230.

Activity

  1. fullsend-ai-triage commented on Nov 19, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 10:17 PM UTC · Completed 10:19 PM UTC

    Commit: 71fa914 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.17

  2. added
    triaged
    on Nov 19, 2026
  3. fullsend-ai-triage commented on Nov 19, 2026

    @fullsend-ai-triage

    Triage found no open PR or duplicate issue for this.

    Scope check against the repo

    • The trusted expression constant and TestWorkflowSHAUsesAreTrusted are in internal/scaffold/pr_trigger_test.go. The test covers only reusable-dispatch.yml and reusable-prioritize.yml.
    • reusable-poll-jira.yml reads job.workflow_sha raw at the ref: and workflow_sha: inputs.
    • The per-repo shim does trigger on pull_request_review.
    • The triage checkout still shows some raw job.workflow_sha uses in the startup-failure reporter fetch lines. This is probably because the checkout predates the fix from fix(dispatch): read job.workflow_sha through the trusted expression in the startup-failure fallback #9721. Rebase before editing.

    Workflow changes required: the fix edits files under .github/workflows/, which the code agent cannot modify under current permissions. A maintainer or human PR is needed, so automatic code-agent dispatch is skipped.

    Suggested order

    1. Confirm on a test repository whether job.workflow_sha equals the merge commit on a same-repo pull_request_review run. This empirical step gates the predicate change.
    2. If confirmed, update the predicate and the test constant together in one change.
    3. Decide for the Jira poll between adopting the trusted expression (and adding it to the test list) or documenting an exemption in the test.

    Proposed test

    For each file in the checked list (including reusable-poll-jira.yml, or an explicit documented exemption):
      every ${{ }} line containing job.workflow_sha must contain the trustedWorkflowSHA constant
      trustedWorkflowSHA must gate on both pull_request and pull_request_review
    Edge cases: lines using inputs.fullsend_version || <expression>; cache-key lines; run-script lines that interpolate job.workflow_sha inside a gh api URL.
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriaged

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions