Skip to content

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

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

ci: graceful-skip ggshield when GITGUARDIAN_API_KEY isn't set#21
tablackburn merged 2 commits 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
@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@tablackburn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 46 minutes and 25 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e2e9c2e-5839-4432-b6de-fca70f01678a

📥 Commits

Reviewing files that changed from the base of the PR and between c48bed5 and 8af9b36.

📒 Files selected for processing (1)
  • .github/workflows/ggshield.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/graceful-skip-missing-secrets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

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 GitHub Actions workflow to gracefully no-op when GITGUARDIAN_API_KEY is not configured, preventing unnecessary workflow failures (especially for actors/events without secret access).

Changes:

  • Adds a job-level passthrough of GITGUARDIAN_API_KEY and gates scan steps on it being non-empty.
  • Keeps the Dependabot actor skip while shifting secret-presence gating to step-level if: conditions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ggshield.yaml Outdated
Comment thread .github/workflows/ggshield.yaml Outdated
@codecov

codecov Bot commented May 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Per Copilot review feedback: the previous job-level env exposed the full
secret value to every step in the job (including actions/checkout and any
future additions), even though only the ggshield-action step needs it.

Switches to a boolean-gate pattern: job-level env exposes only
GGSHIELD_ENABLED (a "true"/"false" string indicating whether the secret
is set), and the actual GITGUARDIAN_API_KEY value is scoped via
step-level env on the ggshield-action invocation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.

2 participants