Skip to content

fix: checkout PR head for labeled integration tests - #560

Merged
Songmu merged 1 commit into
mainfrom
fix/integration-pr-head
Oct 13, 2026
Merged

Songmu merged 1 commit into
mainfrom
fix/integration-pr-head

Conversation

@Songmu

@Songmu Songmu commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

For large changes, there are cases where we want to run integration tests before merging, but the current setup was not working properly.

Summary

  • Check out the PR head SHA from the label event for pull_request_target integration tests, rather than the default-branch commit.
  • Enable allow-unsafe-pr-checkout for pull_request_target so labeled fork PRs can also be tested.

Background

Adding the integration-test label currently runs tests against main instead of the PR changes because checkout does not specify the PR head SHA.

Validation

  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 .github/workflows/integration.yml
  • git diff --check

The updated label-triggered checkout has not been exercised in a live workflow run.

Use the pull request head SHA for label-triggered integration tests and explicitly allow fork PR checkout in that context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aea8d672-9770-415f-bca2-2d8205f31152
@Songmu

Songmu commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Members who can add the integration-test label can trigger these tests. Before applying the label, review and trust the exact PR head commit, including its tests, Makefile, and dependencies: the workflow executes that code with Google service-account credentials and the configured GitHub token permissions.

allow-unsafe-pr-checkout disables the checkout protection for this event; it does not verify that the PR code is safe. Pinning checkout to the event head SHA prevents later pushes from changing the tested commit, but does not make the selected commit trustworthy.

@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (378c332) #560 (e8780cb) +/-
Coverage 36.4% 36.4% 0.0%
Code to Test Ratio 1:0.9 1:0.9 0.0
Test Execution Time 12s 8s -4s
Details
  |                     | main (378c332) | #560 (e8780cb) | +/-  |
  |---------------------|----------------|----------------|------|
  | Coverage            |          36.4% |          36.4% | 0.0% |
  |   Files             |             32 |             32 |    0 |
  |   Lines             |           3469 |           3469 |    0 |
  |   Covered           |           1265 |           1265 |    0 |
  | Code to Test Ratio  |          1:0.9 |          1:0.9 |  0.0 |
  |   Code              |           7120 |           7120 |    0 |
  |   Test              |           7063 |           7063 |    0 |
+ | Test Execution Time |            12s |             8s |  -4s |

Reported by octocov

@Songmu
Songmu marked this pull request as ready for review October 13, 2026 03:49
@Songmu
Songmu merged commit d94bdb3 into main Oct 13, 2026
1 check passed
@Songmu
Songmu deleted the fix/integration-pr-head branch October 13, 2026 03:50
@github-actions github-actions Bot mentioned this pull request Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址