ci: drop the pull_request_target lane from the integration tests
Merged
MI
2d ago+66+66+01234567890123456789-111-111-012345678901234567890123456789
Description
Removes the pull_request_target lane from integration.yml, ahead of GitHub's Dec 2 change. Once this is merged, Actions policy 14618 (which allows pull_request_target for integration.yml) can be deleted.
Why
- The approval could land on the wrong commit. The fork lane checked out a fork PR's head and ran its install and test code with
DAYTONA_API_KEY, gated only by theintegration-testsapproval. That approval binds to whichever run is waiting, and each run is pinned to the commit that was the PR head when it started. A run waiting for approval keeps its place in the queue; #111's run sat behind a Nov 16 run on a commit that was no longer on the branch. So a contributor could push a malicious commit and then a clean one: "Files changed" shows the clean one, while the waiting run checks out the malicious one. - The required check passed too early. The lane that doesn't own a PR posted a skipped
integration-success, which GitHub counts as passing. #111 showed as mergeable on Nov 17 while its live run was still queued. With one lane, in-repo PRs wait for the real result.
What changes
on:no longer includespull_request_target. The suites check out the default ref again (noref:, noallow-unsafe-pr-checkout);persist-credentials: falsestays.decide()runs suites only for PRs from branches in this repo, and for dispatch. For a fork PR that touches a live-tested package, it setsneeds_maintainer_run.integration-successnever skips. Withneeds_maintainer_run, it reports asintegration-success (fork PR, needs a maintainer run), so the required check stays "Expected" and the fork PR can't merge untested. Fork PRs that don't touch a live-tested package pass as before.- The concurrency key drops the event name, which only separated the two lanes.
- CONTRIBUTING.md tells fork contributors why
integration-successstays pending on their PR, that a maintainer runs the live tests on a copy of it and merges that copy, and that the merged commit credits them as co-author.
Testing
actionlintpasses. I extracted thedecidestep and ran it locally for six cases: in-repo PRs and fork PRs, each with and without a package change, plus dispatch withpiand withall. It routes all six correctly.- Fork PRs are held. I opened test fork PR #129 from
mislavivanda/integrations, built on this branch plus a change inpackages/pi-extension. Itsintegrationrun (44525506813) ran no suites and reportedintegration-success (fork PR, needs a maintainer run). The commit had no check namedintegration-success, so the required check stayed "Expected" (rollup PENDING). - Why the maintainer merges a copy. I pushed the same commit to an in-repo branch and dispatched the workflow on it (run 44525633542; I rejected the deployment on purpose). Its
integration-successwas attached to the commit, but it didn't count for #129: it's not in #129's rollup, and its check suite isn't linked to the PR. So a maintainer run can't make the fork PR itself mergeable, and the maintainer merges an in-repo copy instead. - Not testable before merge: the in-repo gate fix. Until this is merged,
main'spull_request_targetlane still posts a skippedintegration-successon every PR. After merge, an in-repo PR that touches a package should showintegration-successas "Expected" until its live run is approved and passes.
#129, its branches, and main's old fork-lane run on it are cleaned up. That run was cancelled without approval.
Related issue(s)
None.
Scope
- This PR touches no more than one package/app (release routing is by changed file path).
- The PR title follows Conventional Commits
(e.g.feat(pi-extension): ...,fix(adk-plugin): ...) — it becomes the squash-commit
message that release-please reads.
Checks
- I ran the affected package's lint/build/test locally and they pass. (CI-only change.
actionlintpasses, plus the tests above.) - I updated documentation where relevant. (CONTRIBUTING.md)
Legal
- Every commit is signed off for the
DCO (git commit -s); the sign-off matches the
commit author. - I agree to the
Contributor License Agreement.
On my first PR, the CLA assistant will comment and I will reply to sign (once).
See CONTRIBUTING.md for
details.