Skip to content

Commit f869c0e

Browse files
tablackburnclaude
andcommitted
ci: graceful-skip ggshield when GITGUARDIAN_API_KEY isn't set
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>
1 parent 1489525 commit f869c0e

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/ggshield.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ jobs:
88
scanning:
99
name: GitGuardian Scan
1010
runs-on: ubuntu-latest
11-
# Skip for Dependabot PRs - they don't have access to secrets and only update dependencies
11+
# Skip Dependabot PRs (no secret access, only updates dependencies). The
12+
# secret-presence check is enforced per-step via `env.GITGUARDIAN_API_KEY`
13+
# below, because the `secrets` context isn't available in `if:` expressions.
1214
if: github.actor != 'dependabot[bot]'
15+
env:
16+
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
1317
steps:
1418
- uses: actions/checkout@v6
19+
if: env.GITGUARDIAN_API_KEY != ''
1520
with:
1621
fetch-depth: 0
1722
- uses: GitGuardian/ggshield-action@v1
18-
env:
19-
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
23+
if: env.GITGUARDIAN_API_KEY != ''

0 commit comments

Comments
 (0)