Skip to content

Commit 3c3fb72

Browse files
committed
Delete checkout credential files, not just config entries
1 parent 0c63222 commit 3c3fb72

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,13 @@ runs:
266266
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
267267
# Remove checkout's credential helpers so the app token in the URL is used
268268
git config --unset-all http.https://github.com/.extraheader || true
269-
# checkout@v6 uses includeIf.gitdir entries pointing to credential files
269+
# checkout@v6 uses includeIf.gitdir entries pointing to credential files;
270+
# remove entries AND delete the credential files themselves
270271
git config --local --get-regexp 'includeIf\..*\.path' | while read key value; do
271272
git config --local --unset "$key" || true
273+
rm -f "$value"
272274
done || true
275+
rm -f /home/runner/work/_temp/git-credentials-*.config
273276
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git"
274277
# Unshallow if needed — shallow clones can cause push failures
275278
if [ -f "$(git rev-parse --git-dir)/shallow" ]; then

0 commit comments

Comments
 (0)