Skip to content

fix(ci): fix ci-merge-coverage workflow failing with git rev-parse error#2742

Open
bhuvan-somisetty wants to merge 1 commit into
kubearmor:mainfrom
bhuvan-somisetty:fix/ci-merge-coverage-git-rev-parse
Open

fix(ci): fix ci-merge-coverage workflow failing with git rev-parse error#2742
bhuvan-somisetty wants to merge 1 commit into
kubearmor:mainfrom
bhuvan-somisetty:fix/ci-merge-coverage-git-rev-parse

Conversation

@bhuvan-somisetty

Copy link
Copy Markdown

Summary

  • ci-merge-coverage was failing on every run on main (e.g. run for 106f8de) with fatal: not a git repository (or any of the parent directories): .git and exit code 128.
  • Root cause: the "Check if all required workflows completed successfully" step calls git rev-parse HEAD before the actions/checkout step has run, so no git repo exists yet in the runner workspace.
  • Fix: move actions/checkout and actions/setup-go before the check step, and use github.event.workflow_run.head_sha instead of git rev-parse HEAD (this workflow is triggered by workflow_run, so that's the correct commit reference anyway).
  • Also sanitized the per-workflow status env var name (ci-test-ginkgo_status -> ci_test_ginkgo_status, since hyphenated env context keys are unreliable) and switched to GH_TOKEN for gh CLI auth.

Test plan

  • Reviewed the failing run logs on main confirming git rev-parse HEAD fails pre-checkout
  • YAML validated locally
  • Verify ci-merge-coverage passes on the next ci-test-ginkgo completion after merge

The check step ran 'git rev-parse HEAD' before the checkout step, so
there was no git repository present yet and the job failed with
'fatal: not a git repository'. Move checkout/setup-go before the
check step and use github.event.workflow_run.head_sha instead, since
this workflow is triggered by workflow_run and has no checked-out
commit until then.

Also sanitize the per-workflow status env var name (hyphens are
invalid in the downstream env context lookup) and switch to GH_TOKEN
for gh CLI auth.

Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
@bhuvan-somisetty

Copy link
Copy Markdown
Author

This fixes the `ci-merge-coverage` failures on `main` (e.g. run for 106f8de) — the "Check if all required workflows completed successfully" step ran `git rev-parse HEAD` before `actions/checkout`, so there was no git repo yet and it failed with `fatal: not a git repository` (exit 128). Moved checkout/setup-go earlier and switched to `github.event.workflow_run.head_sha`, which is the correct commit reference for a `workflow_run`-triggered job anyway. Also sanitized the per-workflow env var name and switched to `GH_TOKEN` for `gh` CLI auth.

Note: `security/snyk (KubeArmor)` is failing with "You have used your limit of private tests" — that's a Snyk org billing/quota limit unrelated to this change, and it's not a required check.

@Aryan-sharma11 @AryanBakliwal @achrefbensaad requesting review, thanks!

bhuvan-somisetty added a commit to bhuvan-somisetty/KubeArmor that referenced this pull request Jul 9, 2026
Separation of concerns per review feedback — that fix now lives in a
dedicated PR (kubearmor#2742). This PR should only contain
the operator InitContainers fix.

Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
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.

1 participant