Skip to content

ci: graceful-skip ggshield when GITGUARDIAN_API_KEY isn't set#5

Merged
tablackburn merged 1 commit into
mainfrom
ci/graceful-skip-missing-secrets
May 10, 2026
Merged

ci: graceful-skip ggshield when GITGUARDIAN_API_KEY isn't set#5
tablackburn merged 1 commit into
mainfrom
ci/graceful-skip-missing-secrets

Conversation

@tablackburn
Copy link
Copy Markdown
Owner

Summary

Propagates PowerShellModuleTemplate#28 to this repo. Updates .github/workflows/ggshield.yaml to use the env-passthrough pattern so the GitGuardian Scan job no-ops cleanly when GITGUARDIAN_API_KEY isn't configured, instead of failing the workflow run.

Why

Defensive alignment with the template's new convention. This repo currently has GITGUARDIAN_API_KEY set, 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

  • The secrets context isn't available in if: expressions, so the gate uses job-level env + step-level if: env.X != ''.
  • The explicit Dependabot actor check is kept for self-documentation, even though Dependabot PRs would now be skipped naturally by the env check (no secret access).

Test plan

  • CI passes (existing required checks)
  • GitGuardian Scan runs (gate evaluates true here)

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 10, 2026 05:23
@tablackburn tablackburn enabled auto-merge (squash) May 10, 2026 05:23
@tablackburn tablackburn merged commit 4916e57 into main May 10, 2026
11 checks passed
@tablackburn tablackburn deleted the ci/graceful-skip-missing-secrets branch May 10, 2026 05:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 env passthrough for GITGUARDIAN_API_KEY sourced from secrets.
  • 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.

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.

2 participants