Skip to content

feat: Add persist-credentials input#69

Merged
Mrtenz merged 1 commit into
mainfrom
mrtenz/persist-credentials
Jun 9, 2026
Merged

feat: Add persist-credentials input#69
Mrtenz merged 1 commit into
mainfrom
mrtenz/persist-credentials

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a persist-credentials input passed through to the actions/checkout step.
  • Defaults to true to preserve existing behaviour.
  • Setting to false prevents accidental GitHub token leaks in workflows that don't need authenticated Git operations.

Note

Low Risk
Small, backward-compatible composite-action input with default true; only affects checkout credential persistence when callers opt out.

Overview
Adds a persist-credentials action input (default true) and forwards it to the conditional actions/checkout step so callers can disable storing the GitHub token in the repo’s git config.

Setting persist-credentials: false is intended to reduce accidental token exposure in workflows that do not need authenticated git operations after checkout; workflows that rely on the checked-out repo for authenticated GitHub API calls can keep the default.

Reviewed by Cursor Bugbot for commit 5a07bfa. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a new `persist-credentials` input that is passed through to the
`actions/checkout` step. Defaults to `true` to preserve existing
behaviour, but can be set to `false` to prevent accidental token leaks.
@Mrtenz Mrtenz changed the title feat: Add persist-credentials input feat: Add persist-credentials input Jun 9, 2026
Comment thread action.yml
persist-credentials:
description: 'Whether to persist the GitHub token in the checked-out repository. This is passed to the `actions/checkout` step. Setting this to false can help prevent accidental token leaks, but if your workflow needs to make authenticated GitHub API calls using the checked-out repository, you may need to set this to true (default).'
required: false
default: 'true'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered making this false by default, but that would be a breaking change as any subsequent steps would no longer to pull, fetch, push, etc. so this is the best we can do for now. We should make this false in the next major version (or even force this to be false, and have subsequent steps use the GitHub token themselves).

@Mrtenz Mrtenz marked this pull request as ready for review June 9, 2026 07:55
@Mrtenz Mrtenz requested a review from a team as a code owner June 9, 2026 07:55
@Mrtenz Mrtenz merged commit 0c89360 into main Jun 9, 2026
35 checks passed
@Mrtenz Mrtenz deleted the mrtenz/persist-credentials branch June 9, 2026 08:05
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.

3 participants