ci: skip Puppeteer & BrowserStack for instructions-only PRs#4598
Draft
raineorshine wants to merge 1 commit into
Draft
ci: skip Puppeteer & BrowserStack for instructions-only PRs#4598raineorshine wants to merge 1 commit into
raineorshine wants to merge 1 commit into
Conversation
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>
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Skip the expensive Puppeteer and BrowserStack CI jobs when a PR changes nothing but
.github/instructions/**/*.Why not
paths-ignorePuppeteerandBrowserStackare required status checks onmain. Apaths-ignoretrigger 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-levelifinstead. A job skipped throughifstill reports its required-check context as passing, keeping instructions-only PRs mergeable (same principle as the existingchanged_files > 0guard this replaces).How
Each workflow gains a cheap
Changesgate job usingdorny/paths-filter@v3:'!.github/instructions/**'→ outputrun == 'true'when at least one changed file is outside.github/instructions/; instructions-only (or empty) change sets yieldfalse.needs: changes+if: <event guard> || needs.changes.outputs.run == 'true'.main,workflow_dispatch) always run — only PRs are gated.Notes on
ios.yml(pull_request_target)pull-requests: readand does not check out the PR's fork head (the plain checkout resolves to the trusted base commit underpull_request_target), so no untrusted code runs in the privileged context.Testing
actionlintclean on the added gate jobs (the two remainingactionlintnotes —queue: maxand an SC2086 in the serve script — are pre-existing and unrelated).