Skip to content

Commit

Permalink
fix: Use the recommended 'persist-credentials: false' setting
Browse files Browse the repository at this point in the history
The GitHub checkout action has this `persist-credentials` setting.

It's described like this:

    # Whether to configure the token or SSH key with the local git config
    # Default: true
    persist-credentials: ''

Sounds harmless, right? It almosts makes it sound as if it's going to
modify `~/.gitconfig`.

This default of `true` causes credentials to end up in the working
copy's `.git/config`, which interacts badly with other stuff happening
in GHA.

Set it to false just in case.

Signed-off-by: Marcelo E. Magallon <[email protected]>
  • Loading branch information
mem committed Jan 15, 2025
1 parent f4f1c5d commit 5bfbdd5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
fetch-depth: 0
fetch-tags: true

Expand Down Expand Up @@ -165,6 +166,7 @@ jobs:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up global git config
Expand Down Expand Up @@ -268,6 +270,7 @@ jobs:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
fetch-depth: 0

- name: Setup Go
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/renovate-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Self-hosted renovate
uses: grafana/sm-renovate/actions/renovate-validate@main
3 changes: 3 additions & 0 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Self-hosted renovate
uses: grafana/sm-renovate/actions/renovate@main
1 change: 1 addition & 0 deletions .github/workflows/validate_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
fetch-depth: 0
fetch-tags: true

Expand Down

0 comments on commit 5bfbdd5

Please sign in to comment.