Skip to content

Commit a618ab1

Browse files
mikolalysenkoclaude
andcommitted
ci: scope publish secrets behind a deployment environment (zizmor secrets-outside-env)
The Audit runs `zizmor .github --min-severity medium`, which failed on four `secrets-outside-env` MEDIUM findings — the new RubyGems/Composer publish jobs referenced `secrets.*` without a dedicated GitHub environment (release.yml gem-publish; release-ecosystems.yml rubygems-cli + packagist-cli). Add a job `environment:` (`rubygems` / `packagist`) to each, which scopes the secret (and lets a maintainer later gate publishing with required reviewers; the env is auto-created with no protection until configured). Verified with the org's exact invocation (zizmor 1.23.1, `.github`, --min-severity medium): the four findings are gone; the only remaining medium is the pre-existing artipacked on release.yml:182 (not mine, suppressed in the org's --gh-token run). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 365a841 commit a618ab1

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/release-ecosystems.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ jobs:
5555
rubygems-cli:
5656
needs: resolve-version
5757
runs-on: ubuntu-latest
58+
# Scope the publish secret to a deployment environment (zizmor
59+
# secrets-outside-env); also lets a maintainer gate publishing with required
60+
# reviewers. Auto-created with no protection rules until configured.
61+
environment: rubygems
5862
permissions:
5963
contents: read
6064
steps:
@@ -106,6 +110,9 @@ jobs:
106110
packagist-cli:
107111
needs: resolve-version
108112
runs-on: ubuntu-latest
113+
# Scope the Packagist secrets to a deployment environment (zizmor
114+
# secrets-outside-env); auto-created with no protection until configured.
115+
environment: packagist
109116
permissions:
110117
contents: read
111118
steps:

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,9 @@ jobs:
471471
if: ${{ !inputs.dry-run }}
472472
runs-on: ubuntu-latest
473473
continue-on-error: true
474+
# Scope the publish secret to a deployment environment (zizmor
475+
# secrets-outside-env); auto-created with no protection until configured.
476+
environment: rubygems
474477
permissions:
475478
contents: read
476479
steps:

0 commit comments

Comments
 (0)