Repository navigation
ci(checkov): commit skip config instead of reading a repo variable - #968
Open
marcleblanc2 wants to merge 1 commit into
Open
marcleblanc2 wants to merge 1 commit into
marcleblanc2 wants to merge 1 commit into
Conversation
Fork PRs do not receive repository variables, so the 'Write skip checks config' step wrote an empty .checkov.yaml and checkov exited 2 with 'config file ... returned type NoneType'. Move the skip list into a committed .checkov.yaml, which checkov loads automatically, and drop the step and the CHECKOV_SKIP_CHECKS variable. Verified locally with checkov 3.3.29: --show-config loads the file and the chart scan reports 1442 passed / 0 failed, same as main. Amp-Thread-ID: https://ampcode.com/threads/T-01a1571c-39af-708a-a421-a575d606dae7 Co-authored-by: Amp <amp@ampcode.com>
This branch has not been deployed
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 Checkov workflow writes
.checkov.yamlfrom${{ vars.CHECKOV_SKIP_CHECKS }}at runtime. Fork PRs don't receive repository variables, so the file ends up empty and checkov exits 2:The SARIF upload step then fails because
results.sarifwas never written. Example: https://github.com/sourcegraph/deploy-sourcegraph-helm/actions/runs/39357525392/job/118415955536?pr=902Fix
Commit the skip list as
.checkov.yaml(same contents as the repo variable, sorted) and drop the runtime step. Checkov loads.checkov.yamlfrom the working directory automatically. This matches howdeploy-sourcegraph-managedalready does it.The
CHECKOV_SKIP_CHECKSrepo variable can be deleted once this merges.Test plan
checkov --show-config -d ./chartsloads the committed file with the sameskip-path/skip-checklists as the variable