Skip to content

Fix broken gem releases: restore persisted checkout credentials in cd.yml#27

Merged
dduugg merged 1 commit into
mainfrom
fix-cd-persist-credentials
Jul 25, 2026
Merged

Fix broken gem releases: restore persisted checkout credentials in cd.yml#27
dduugg merged 1 commit into
mainfrom
fix-cd-persist-credentials

Conversation

@dduugg

@dduugg dduugg commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Every gem release via this reusable cd.yml has been silently broken since persist-credentials: false was added to the deploy job's checkout step. discourse/publish-rubygems-action's entrypoint.sh runs rake release, which does a raw git push — but the script never authenticates with GITHUB_TOKEN itself (confirmed by reading the action's source: it only ever uses GITHUB_TOKEN... it doesn't, actually — it's passed in env: but the entrypoint never references it). It relies entirely on the git credential that actions/checkout leaves behind. Disabling persistence means there's nothing to push with.

This isn't theoretical — confirmed in production:

$ gh run view <run> --repo rubyatscale/danger-migrations --log-failed
...
Tagged v0.15.0.
Untagging v0.15.0 due to error.
rake aborted!
Running `git push origin refs/heads/main` failed with the following output:
fatal: could not read Username for 'https://github.com': No such device or address

rubyatscale/danger-migrations (which calls this same reusable workflow) has failed 9 of its last 10 CD runs since this line was added (2026-04-14 per this repo's history), with no successful release since 2026-03-05. Every other repo calling shared-config/cd.yml@main — including rubyatscale/visualize_packs — is equally affected and just hasn't attempted a real release recently enough to notice.

Changes

  • Removed persist-credentials: false from the deploy job's checkout step (reverts to the default true, which is required here), with a # zizmor: ignore[artipacked] suppression and comment explaining why — this step deliberately needs to leave credentials behind, unlike a typical read-only checkout.
  • Fixed two stale version comments caught by zizmor's ref-version-mismatch audit (only visible in online mode via --gh-token, not the default offline mode): the checkout SHA is actually tagged v7.0.0 today (not v6 — floating major tags move), and the slack-github-action SHA is v3.0.3 (not just v3).

Test plan

  • zizmor .github/workflows/cd.yml — 0 findings, both offline and with --gh-token
  • Confirm the next real release through this workflow (e.g. in danger-migrations or visualize_packs) actually succeeds in pushing its tag

….yml

The deploy job's checkout step set persist-credentials: false, but
discourse/publish-rubygems-action's entrypoint.sh runs `rake release`,
which does a raw `git push` and never re-authenticates using
GITHUB_TOKEN itself - it relies entirely on the git credential that
checkout leaves behind. Disabling persistence broke every deploy with:

  fatal: could not read Username for 'https://github.com': No such
  device or address

Confirmed in production: rubyatscale/danger-migrations (which calls
this same reusable cd.yml) has failed 9 of its last 10 CD runs since
this line was added, all with that exact error.

Also fixes two stale/incorrect version comments caught by zizmor's
ref-version-mismatch audit (only visible with --gh-token, not in the
default offline mode): the checkout SHA is actually tagged v7.0.0, not
v6, and the slack-github-action SHA is v3.0.3, not just v3.

Verified with `zizmor .github/workflows/cd.yml`, both offline and
--gh-token: 0 findings.
@dduugg
dduugg requested a review from a team as a code owner July 25, 2026 05:19
@github-project-automation github-project-automation Bot moved this to Triage in Modularity Jul 25, 2026
@dduugg
dduugg merged commit ad28014 into main Jul 25, 2026
4 checks passed
@dduugg
dduugg deleted the fix-cd-persist-credentials branch July 25, 2026 05:23
@github-project-automation github-project-automation Bot moved this from Triage to Done in Modularity Jul 25, 2026
dduugg added a commit that referenced this pull request Jul 25, 2026
Fixes the 9 open alerts at
https://github.com/rubyatscale/shared-config/security/code-scanning:

- zizmor/ref-version-mismatch (8 alerts): stale version comments on
  already-pinned SHAs across ci.yml, stale.yml, and zizmor.yml. Floating
  major tags (v6, v1, v3, v10) move forward as new releases ship, so a
  comment written when a SHA was "the current v6" goes stale once v6
  moves on. Same class of issue already fixed in cd.yml (#27). Updated
  each comment to the precise version currently tagged at that exact
  SHA (v7.0.0, v1.314.0, v3.0.3, v10.3.0 respectively) - the pinned
  SHAs themselves are unchanged.
- zizmor/artipacked (1 alert): codeql.yml's checkout step didn't set
  persist-credentials: false. Unlike cd.yml's deploy job, this one only
  reads the repo for analysis and never pushes, so disabling
  persistence is correct here (no exception needed).

Verified with `zizmor .github/workflows/`, both offline and
--gh-token: 0 findings across every workflow in the repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant