ci: drop the pull_request_target lane from the integration tests

Merged
MI
2d ago
+66-111

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 the integration-tests approval. 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 includes pull_request_target. The suites check out the default ref again (no ref:, no allow-unsafe-pr-checkout); persist-credentials: false stays.
  • 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 sets needs_maintainer_run.
  • integration-success never skips. With needs_maintainer_run, it reports as integration-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-success stays 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

  • actionlint passes. I extracted the decide step and ran it locally for six cases: in-repo PRs and fork PRs, each with and without a package change, plus dispatch with pi and with all. 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 in packages/pi-extension. Its integration run (44525506813) ran no suites and reported integration-success (fork PR, needs a maintainer run). The commit had no check named integration-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-success was 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's pull_request_target lane still posts a skipped integration-success on every PR. After merge, an in-repo PR that touches a package should show integration-success as "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. actionlint passes, 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.