ci: graceful-skip ggshield when GITGUARDIAN_API_KEY isn't set#5
Merged
Conversation
Mirrors PowerShellModuleTemplate#28: env-passthrough pattern so a repo without the secret configured no-ops cleanly instead of failing the ggshield workflow run. This repo currently has the secret configured, so this is a defensive alignment with the template — no behavior change today, but matches the convention going forward. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the GitGuardian scan workflow to gracefully no-op when GITGUARDIAN_API_KEY is not configured, instead of failing the workflow run. This aligns the repo’s CI behavior with the referenced template convention.
Changes:
- Adds a job-level
envpassthrough forGITGUARDIAN_API_KEYsourced fromsecrets. - Gates the checkout and ggshield scan steps with
if: env.GITGUARDIAN_API_KEY != ''so the job cleanly skips when the secret is unavailable. - Keeps the Dependabot actor skip while documenting why the secret check is implemented at step level.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Propagates PowerShellModuleTemplate#28 to this repo. Updates
.github/workflows/ggshield.yamlto use the env-passthrough pattern so the GitGuardian Scan job no-ops cleanly whenGITGUARDIAN_API_KEYisn't configured, instead of failing the workflow run.Why
Defensive alignment with the template's new convention. This repo currently has
GITGUARDIAN_API_KEYset, so there's no behavior change today — the gate evaluates true and the scan runs as before. The value is for any future state where the secret is rotated, removed, or unset.Notes
secretscontext isn't available inif:expressions, so the gate uses job-levelenv+ step-levelif: env.X != ''.Test plan
GitGuardian Scanruns (gate evaluates true here)🤖 Generated with Claude Code