Skip to content

ci: skip workflows for PRs tagged [skip ci] or labeled skip-ci#4291

Merged
andygrove merged 2 commits into
apache:mainfrom
andygrove:ci/skip-ci-tag
May 12, 2026
Merged

ci: skip workflows for PRs tagged [skip ci] or labeled skip-ci#4291
andygrove merged 2 commits into
apache:mainfrom
andygrove:ci/skip-ci-tag

Conversation

@andygrove
Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A.

Rationale for this change

Allow contributors to opt out of CI runs on work-in-progress PRs by adding [skip ci] to the PR title. Saves runner minutes for draft iterations where CI feedback is not yet needed. Push events on main are unaffected; GitHub already honors [skip ci] in commit messages for push triggers.

What changes are included in this PR?

Adds a job-level if: gate to the entry job of every PR-triggered workflow:

if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]') }}

Downstream jobs cascade-skip via their needs: chain. Affected workflows: codeql, iceberg_spark_test, miri, pr_benchmark_check, pr_build_linux, pr_build_macos, pr_markdown_format, pr_missing_suites, pr_rat_check, pr_title_check, spark_sql_test, validate_workflows.

Note: removing [skip ci] from the title alone will not re-trigger workflows. A new push (or close/reopen) is required. This avoids re-triggering on every description edit, which would happen if edited were added to pull_request.types.

How are these changes tested?

YAML validity confirmed locally. Behavior verifiable by opening a follow-up PR with [skip ci] in the title and observing that all CI jobs are skipped.

Add a job-level if: gate to the entry job of every PR-triggered
workflow. When the PR title contains [skip ci], the entry job is
skipped and downstream jobs cascade-skip via needs. Push triggers
are unaffected since GitHub natively honors [skip ci] in commit
messages for push events.
Copy link
Copy Markdown
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @andygrove wondering if we can use a github tag instead of title?

@andygrove
Copy link
Copy Markdown
Member Author

Thanks @andygrove wondering if we can use a github tag instead of title?

Only committers have the ability to add labels but anyone can edit the title of their own PRs

@andygrove
Copy link
Copy Markdown
Member Author

Thanks @andygrove wondering if we can use a github tag instead of title?

Only committers have the ability to add labels but anyone can edit the title of their own PRs

I added the option to use either approach

@andygrove andygrove changed the title ci: skip workflows for PRs tagged [skip ci] ci: skip workflows for PRs tagged [skip ci] or labeled skip-ci May 12, 2026
@andygrove andygrove added the skip-ci Skip CI runs label May 12, 2026
Copy link
Copy Markdown
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @andygrove

@andygrove andygrove merged commit db0dbcf into apache:main May 12, 2026
24 checks passed
@andygrove andygrove deleted the ci/skip-ci-tag branch May 12, 2026 16:23
@comphead
Copy link
Copy Markdown
Contributor

image Actually this looks dangerous, we can possibly merge non verified PR

@andygrove
Copy link
Copy Markdown
Member Author

image Actually this looks dangerous, we can possibly merge non verified PR

PR to revert #4301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-ci Skip CI runs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants