ci: fix plugin workflow diff target for push events - #1222
Open
Krypto-Knight-05 wants to merge 2 commits into
Open
ci: fix plugin workflow diff target for push events#1222Krypto-Knight-05 wants to merge 2 commits into
Krypto-Knight-05 wants to merge 2 commits into
Conversation
Krypto-Knight-05
requested review from
ashu8912,
illume,
joaquimrocha,
skoeva,
sniok,
vyncent-t and
yolossn
as code owners
August 18, 2026 20:05
added 2 commits
August 19, 2026 01:40
On push to main, HEAD and origin/main point to the same commit, causing git diff to always return empty and all plugin jobs to be skipped. Fix by using github.event.before (the SHA before the push) as the base ref for push events, while keeping origin/main for PRs. Fixes headlamp-k8s#1133 Signed-off-by: Krypto-Knight-05 <bansalarnav546@gmail.com>
When a brand new branch is pushed for the first time, GitHub sets github.event.before to all zeros (0000000000000000000000000000000000000000). Running git diff against that SHA causes the action to crash. Add a fallback to HEAD~1 when the before SHA is the null hash. Signed-off-by: Krypto-Knight-05 <bansalarnav546@gmail.com>
Krypto-Knight-05
force-pushed
the
fix/push-runs-skip-plugin-checks
branch
from
August 18, 2026 20:10
6b7b499 to
8ffd83b
Compare
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.
Problem
The plugin workflow runs after pushes to
main, but it comparesHEADwithorigin/main. On a push event, both refs point to the same commit, so the diff is always empty and every plugin job is skipped.Fixes #1133.
Fix
github.event.before(the SHA immediately before the push) as the base ref when the event is apush.origin/mainforpull_requestevents (unchanged behavior).HEAD~1to handle edge cases where thebeforeSHA is all zeros (e.g., force-pushes or new branches).