Skip to content

Skip integration tests on fork PRs#68

Merged
Andarist merged 1 commit into
changesets:mainfrom
ocavue-forks:ocavue/ci-fork
May 19, 2026
Merged

Skip integration tests on fork PRs#68
Andarist merged 1 commit into
changesets:mainfrom
ocavue-forks:ocavue/ci-fork

Conversation

@ocavue
Copy link
Copy Markdown
Contributor

@ocavue ocavue commented May 19, 2026

Integration tests git push to the repo. Fork PRs only get a read-only GITHUB_TOKEN, so the test job always 403s. This PR skips the test job when the PR comes from a fork.

If my understanding is correct, coverage is unchanged because merge_group still runs the full suite before merge:

name: CI

on:
  pull_request:
  merge_group:
    branches:
      - main

The resulting flow for a fork contribution:

  1. A PR from their fork, pull_request fires. Code is untrusted, GITHUB_TOKEN is read-only, CI / Test is skipped.
  2. Maintainer reviews, approves, and clicks Add to merge queue button.
  3. merge_group fires in the base repo context with a writable GITHUB_TOKEN, running the full suite against the now-trusted code.
    • If all jobs in merge_group pass, the commit lands on main.
    • If CI / Test in merge_group fails, the required check CI / CI OK will also fail, and the commit won't land.

@ocavue ocavue marked this pull request as ready for review May 19, 2026 11:00
@ocavue ocavue requested review from Andarist and bluwy as code owners May 19, 2026 11:00
Copy link
Copy Markdown
Member

@Andarist Andarist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clever!

@Andarist Andarist added this pull request to the merge queue May 19, 2026
Merged via the queue into changesets:main with commit 37dffc8 May 19, 2026
6 checks passed
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.

2 participants