Skip to content

ci: skip Puppeteer & BrowserStack for instructions-only PRs#4598

Draft
raineorshine wants to merge 1 commit into
mainfrom
raineorshine-copilot-chore-skip-tests-instructions-on
Draft

ci: skip Puppeteer & BrowserStack for instructions-only PRs#4598
raineorshine wants to merge 1 commit into
mainfrom
raineorshine-copilot-chore-skip-tests-instructions-on

Conversation

@raineorshine

Copy link
Copy Markdown
Contributor

Summary

Skip the expensive Puppeteer and BrowserStack CI jobs when a PR changes nothing but .github/instructions/**/*.

Why not paths-ignore

Puppeteer and BrowserStack are required status checks on main. A paths-ignore trigger filter would prevent the workflow from running, leaving the required check unreported — which blocks the PR forever. So the trigger is left unchanged and the heavy job is skipped via a job-level if instead. A job skipped through if still reports its required-check context as passing, keeping instructions-only PRs mergeable (same principle as the existing changed_files > 0 guard this replaces).

How

Each workflow gains a cheap Changes gate job using dorny/paths-filter@v3:

  • Filter '!.github/instructions/**' → output run == 'true' when at least one changed file is outside .github/instructions/; instructions-only (or empty) change sets yield false.
  • The heavy job gains needs: changes + if: <event guard> || needs.changes.outputs.run == 'true'.
  • Non-PR events (push to main, workflow_dispatch) always run — only PRs are gated.

Notes on ios.yml (pull_request_target)

  • The gate job is scoped to pull-requests: read and does not check out the PR's fork head (the plain checkout resolves to the trusted base commit under pull_request_target), so no untrusted code runs in the privileged context.

Testing

  • YAML validated; actionlint clean on the added gate jobs (the two remaining actionlint notes — queue: max and an SC2086 in the serve script — are pre-existing and unrelated).
  • Files verified prettier-clean.

Add a cheap `Changes` gate job (dorny/paths-filter) to the Puppeteer and
BrowserStack workflows. The expensive job is skipped when a PR touches nothing
but .github/instructions/**.

Both jobs are required status checks, so paths-ignore cannot be used (an
unreported check would block merges). Instead the trigger is unchanged and the
heavy job is skipped via `if`, which still reports the required check as passing.
Non-PR events (push to main, workflow_dispatch) always run.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Vercel preview: https://em-b7g5ljhli-cybersemics.vercel.app

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