diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index a1b8c43..2fdfe88 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -118,10 +118,12 @@ jobs: ./build.ps1 -Task Build,Test -Bootstrap - name: Upload Coverage to Codecov - if: success() && steps.template_guard.outputs.is_template == 'false' + if: success() && steps.template_guard.outputs.is_template == 'false' && env.CODECOV_TOKEN != '' + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} uses: codecov/codecov-action@v6 with: - token: ${{ secrets.CODECOV_TOKEN }} + token: ${{ env.CODECOV_TOKEN }} files: out/codeCoverage.xml flags: ${{ matrix.os }} fail_ci_if_error: false diff --git a/.github/workflows/ggshield.yaml b/.github/workflows/ggshield.yaml index a9f6303..412d202 100644 --- a/.github/workflows/ggshield.yaml +++ b/.github/workflows/ggshield.yaml @@ -8,12 +8,16 @@ jobs: scanning: name: GitGuardian Scan runs-on: ubuntu-latest - # Skip for Dependabot PRs - they don't have access to secrets and only update dependencies + # Skip Dependabot PRs (no secret access, only updates dependencies). The + # secret-presence check is enforced per-step via `env.GITGUARDIAN_API_KEY` + # below, because the `secrets` context isn't available in `if:` expressions. if: github.actor != 'dependabot[bot]' + env: + GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} steps: - uses: actions/checkout@v6 + if: env.GITGUARDIAN_API_KEY != '' with: fetch-depth: 0 - uses: GitGuardian/ggshield-action@v1 - env: - GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} + if: env.GITGUARDIAN_API_KEY != ''