Skip to content

Conversation

@semgrep-code-bumble-tech
Copy link

Add persist-credentials: false to the actions/checkout step in the build workflow to prevent GitHub tokens from being stored in .git/config.

Changes

  • Added persist-credentials: false option to the checkout step in .github/workflows/build.yml

Why

By default, actions/checkout persists the GitHub token in the .git/config file. This can be a security risk if subsequent workflow steps or third-party actions have access to the repository directory, as they could potentially extract and misuse the token. Setting persist-credentials: false ensures the token is not stored after the checkout completes, following security best practices for GitHub Actions workflows.

Semgrep Finding Details

actions/checkout persists tokens into .git/config by default. Add persist-credentials: false to the checkout step. [https://bmbl.atlassian.net/wiki/spaces/APS/pages/3220865235/GitHub+Actions+-+Security+Vulnerabilities+And+How+to+Avoid+Them#ArtiPACKED]

@ender.akbas@team.bumble.com requested Semgrep Assistant generate this pull request to fix a finding.


⚠️ Review carefully before merging. This PR was generated by AI and may cause breaking changes or introduce new vulnerabilities.

Add `persist-credentials: false` to the actions/checkout step in the build workflow to prevent GitHub tokens from being stored in `.git/config`.

## Changes
- Added `persist-credentials: false` option to the checkout step in `.github/workflows/build.yml`

## Why
By default, `actions/checkout` persists the GitHub token in the `.git/config` file. This can be a security risk if subsequent workflow steps or third-party actions have access to the repository directory, as they could potentially extract and misuse the token. Setting `persist-credentials: false` ensures the token is not stored after the checkout completes, following security best practices for GitHub Actions workflows.

## Semgrep Finding Details
actions/checkout persists tokens into .git/config by default. Add `persist-credentials: false` to the checkout step. [https://bmbl.atlassian.net/wiki/spaces/APS/pages/3220865235/GitHub+Actions+-+Security+Vulnerabilities+And+How+to+Avoid+Them#ArtiPACKED]


@ender.akbas@team.bumble.com requested Semgrep Assistant generate this pull request to fix [a finding](https://semgrep.dev/orgs/bmbl/findings/545996007).
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.

0 participants