Skip to content

ci: fix plugin workflow diff target for push events - #1222

Open
Krypto-Knight-05 wants to merge 2 commits into
headlamp-k8s:mainfrom
Krypto-Knight-05:fix/push-runs-skip-plugin-checks
Open

ci: fix plugin workflow diff target for push events#1222
Krypto-Knight-05 wants to merge 2 commits into
headlamp-k8s:mainfrom
Krypto-Knight-05:fix/push-runs-skip-plugin-checks

Conversation

@Krypto-Knight-05

Copy link
Copy Markdown

Problem

The plugin workflow runs after pushes to main, but it compares HEAD with origin/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

  • Uses github.event.before (the SHA immediately before the push) as the base ref when the event is a push.
  • Keeps using origin/main for pull_request events (unchanged behavior).
  • Adds a fallback to HEAD~1 to handle edge cases where the before SHA is all zeros (e.g., force-pushes or new branches).

Krypto-Knight-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
Krypto-Knight-05 force-pushed the fix/push-runs-skip-plugin-checks branch from 6b7b499 to 8ffd83b Compare August 18, 2026 20:10
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.

Push runs skip plugin checks

1 participant