Skip to content

Set persist-credentials: false on pull-request workflows that run repository scripts #1998

Description

@hatayama

Context

CodeRabbit flagged missing persist-credentials: false on the new dead-code workflow in PR #1995. That workflow runs repository-controlled tests/scripts on pull requests, so leaving GITHUB_TOKEN in local Git config lets untrusted PR code read it.

The same risk still applies to other pull-request workflows that run repository scripts but do not yet disable credential persistence.

Workflows still missing persist-credentials: false

  • .github/workflows/code-complexity.yml
  • .github/workflows/build-and-test.yml
  • .github/workflows/security-scan.yml
  • .github/workflows/unity-compile-check-and-test-runner.yml

Existing precedents (already set)

Validation

When updating uses: / checkout options, follow docs/github-actions-security.md and run:

cd cli/release-automation
go test ./internal/architecture -run 'TestWorkflowActions|TestPullRequestWorkflow' -count=1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions