Skip to content

Harden license-headers workflow checkout for pull_request_target#36562

Closed
dgomezleon with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-license-headers-linter
Closed

Harden license-headers workflow checkout for pull_request_target#36562
dgomezleon with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-license-headers-linter

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown

The license-headers-linter job failed before linting because actions/checkout now blocks checking out fork head branches in pull_request_target workflows. This change updates the workflow to use the PR merge ref from the base repository so the job can run safely.

  • What changed

    • Updated .github/workflows/license-headers.yml checkout configuration to stop targeting fork repo/head ref.
    • Switched checkout to GitHub’s synthetic PR merge ref:
      • refs/pull/${{ github.event.pull_request.number }}/merge
  • Why this resolves the failure

    • Avoids unsafe fork-code checkout in trusted pull_request_target context.
    • Keeps the workflow operating on the PR content via the merge ref, allowing downstream modified-file and header checks to execute.
- uses: actions/checkout@...
  with:
    ref: refs/pull/${{ github.event.pull_request.number }}/merge

Copilot AI changed the title [WIP] Fix failing GitHub Actions job license-headers-linter Harden license-headers workflow checkout for pull_request_target Jun 29, 2026
Copilot AI requested a review from dgomezleon June 29, 2026 10:10
@dgomezleon dgomezleon closed this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants