Skip to content

ci: run the empty-diff gate only on pull requests - #113

Merged
Jaro-c merged 1 commit into
mainfrom
ci/guard-empty-diff-to-pull-request
Aug 11, 2026
Merged

ci: run the empty-diff gate only on pull requests#113
Jaro-c merged 1 commit into
mainfrom
ci/guard-empty-diff-to-pull-request

Conversation

@Jaro-c

@Jaro-c Jaro-c commented Aug 11, 2026

Copy link
Copy Markdown
Member

The empty-diff reusable reads the pull request base ref and is fail-closed when it is missing, which is right inside a pull request. This workflow also runs on push to main, where there is no pull request payload, so every push to main now fails with "could not determine the pull request base ref".

I am guarding the job with if: github.event_name == 'pull_request' so it is skipped on push instead of failing. A skipped job does not fail the run, and it does not weaken the gate for required-check purposes either, because a required check only gates the merge of a pull request, where the job still runs.

The .github repo has issues disabled, so this PR carries the problem statement in its body.

The reusable reads the pull request base ref and fails closed when it is
missing. That is right inside a pull request and wrong on a push: this
workflow also runs on push to main, where there is no pull request in the
payload, so every push to main has failed since the caller landed.

Guarding the job on the event skips it on push instead of failing. A
skipped job does not fail the run, and it does not weaken the gate for
required-check purposes either, because a required check only gates the
merge of a pull request, where the job still runs.

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
@Jaro-c
Jaro-c merged commit 9afcef0 into main Aug 11, 2026
7 checks passed
@Jaro-c
Jaro-c deleted the ci/guard-empty-diff-to-pull-request branch August 11, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant