fix(ci): fix ci-merge-coverage workflow failing with git rev-parse error#2742
fix(ci): fix ci-merge-coverage workflow failing with git rev-parse error#2742bhuvan-somisetty wants to merge 1 commit into
Conversation
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>
|
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! |
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>
Summary
ci-merge-coveragewas failing on every run onmain(e.g. run for 106f8de) withfatal: not a git repository (or any of the parent directories): .gitand exit code 128.git rev-parse HEADbefore theactions/checkoutstep has run, so no git repo exists yet in the runner workspace.actions/checkoutandactions/setup-gobefore the check step, and usegithub.event.workflow_run.head_shainstead ofgit rev-parse HEAD(this workflow is triggered byworkflow_run, so that's the correct commit reference anyway).ci-test-ginkgo_status->ci_test_ginkgo_status, since hyphenated env context keys are unreliable) and switched toGH_TOKENforghCLI auth.Test plan
mainconfirminggit rev-parse HEADfails pre-checkoutci-merge-coveragepasses on the nextci-test-ginkgocompletion after merge