Skip to content

fix(ci): do not persist the job token in .git/config in the public-repo guard - #77

Closed
yakimoto wants to merge 1 commit into
mainfrom
fix/1870-persist-credentials-false
Closed

fix(ci): do not persist the job token in .git/config in the public-repo guard#77
yakimoto wants to merge 1 commit into
mainfrom
fix/1870-persist-credentials-false

Conversation

@yakimoto

@yakimoto yakimoto commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Why

actions/checkout without persist-credentials: false writes the job's GITHUB_TOKEN into
.git/config, where any later step — or anything those steps execute — can read it. This is the
security gate that DOWNLOADS AND EXECUTES the gitleaks binary, and the workflow's own comment
already reasons about tampered downloads ("so a tampered or MITM'd download can never execute
inside the security gate"), so the threat model is written down and only the credential half of
the mitigation is missing. Found by zizmor as warning[artipacked]: credential persistence through GitHub Actions artifacts.

Safety

Verified this job only: checks out, installs gitleaks (pinned + checksum), runs
gitleaks detect --no-git, installs ripgrep, runs content-policy.sh. permissions: contents: read. Nothing pushes, calls gh, or reads GITHUB_TOKEN/GH_TOKEN, so the token was never needed
in .git/config in the first place.

Refs wave-av/claude-workstation#1870.


Open in Devin Review

Note

Low Risk
Low-risk CI hardening that removes unnecessary credential persistence; scan steps and contents: read permissions are unchanged.

Overview
Hardens the public-repo-guard workflow by setting persist-credentials: false on actions/checkout, so the job’s GITHUB_TOKEN is not stored in .git/config.

That aligns with the gate’s threat model: later steps install and run a pinned gitleaks binary and content-policy scripts, so nothing in the job needs a persisted credential in the repo tree.

Reviewed by Cursor Bugbot for commit e689185. Configure here.

Review in cubic

…po guard

actions/checkout without persist-credentials:false leaves GITHUB_TOKEN readable
in .git/config for every later step — including the one that downloads and
executes the gitleaks binary. Nothing in this job uses the credential
(contents:read, gitleaks runs --no-git, no gh/push steps). Refs #1870.
@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c6784eb1-4842-4970-b130-59c037fb38b0)

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@macroscopeapp

macroscopeapp Bot commented Aug 6, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved e689185

Minor CI security hardening that adds persist-credentials: false to the checkout action, preventing token persistence in git config. The change is made by the file's designated code owner and follows established security best practices.

You can customize Macroscope's approvability policy. Learn more.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix public-repo-guard checkout to avoid persisting GITHUB_TOKEN in .git/config

🐞 Bug fix ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Disable credential persistence during checkout in the public-repo guard workflow.
• Prevent later steps from reading GITHUB_TOKEN via .git/config in this security gate.
• Reduce exposure risk when downloading and executing pinned, checksum-verified binaries.
Diagram

graph TD
  A["public-repo-guard job"] --> B["actions/checkout@v5"] --> D["Install/verify gitleaks"] --> E["gitleaks detect --no-git"] --> F["Run content-policy.sh"]
  B -. "before: wrote token" .-> C[(".git/config")]
  B -. "now: persist-credentials=false" .-> C
Loading
High-Level Assessment

Using actions/checkout with persist-credentials: false is the simplest, standard mitigation to prevent GITHUB_TOKEN from being written to .git/config. Alternatives like removing checkout entirely or using a blank token would either break the job’s need for repo contents or be less explicit/idiomatic than the dedicated flag.

Files changed (1) +2 / -0

Other (1) +2 / -0
public-repo-guard.ymlDisable credential persistence in checkout step +2/-0

Disable credential persistence in checkout step

• Adds 'persist-credentials: false' to the workflow’s 'actions/checkout' step. This prevents the job’s GITHUB_TOKEN from being stored in '.git/config', reducing exposure to subsequent steps and executed binaries.

.github/workflows/public-repo-guard.yml

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 31 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6d70f592-7161-48f8-ad63-727034b6d527

📥 Commits

Reviewing files that changed from the base of the PR and between a8a7fd4 and e689185.

📒 Files selected for processing (1)
  • .github/workflows/public-repo-guard.yml

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

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

Qodo Fixer

No findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@yakimoto

yakimoto commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

This PR is redundant with #74 (chore/guard-canonical-sync), which is already open and already contains this exact change.

Evidence — #74's diff to .github/workflows/public-repo-guard.yml includes:

+          # tree. Nothing here pushes -- the scan is `--no-git` over the working tree --
+          # so no step needs authenticated Git; drop it. (zizmor: artipacked)
+          persist-credentials: false

#74 is also broader than this PR: it syncs the whole vendored public-repo-guard trio to
the canonical source (wave-foundation/scaffolder/public-repo-guard) byte-for-byte, verified by
git blob SHA, rather than adding this one line in isolation.

Closing as redundant. This duplicate exists because the fan-out that opened this PR
(refs claude-workstation#1870) did not check for in-flight PRs touching the same file before
going out — #74 was already open. Merge #74 instead.

@yakimoto yakimoto closed this Aug 6, 2026
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.

1 participant