Skip to content

Commit 4a96dc4

Browse files
committed
ci: Use credential.helper cache instead of credential.helper store
1 parent d858f81 commit 4a96dc4

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,19 +310,24 @@ jobs:
310310
)
311311
fi
312312
313-
prev_credential_helper=$(git config get --global credential.helper || true)
313+
prev_credential_helper=$(git config get --local credential.helper || true)
314314
if [[ -n "${prev_credential_helper}" ]]; then
315315
printf 'credential helper is already set (%s)\n' "${prev_credential_helper}"
316316
else
317+
protocol="${GITHUB_SERVER_URL%%://*}"
318+
hostname="${GITHUB_SERVER_URL#*://}"
317319
(
318320
set -x
319-
git config --global credential.helper store
321+
git config --local credential.helper cache
320322
)
321-
protocol="${GITHUB_SERVER_URL%%://*}"
322-
hostname="${GITHUB_SERVER_URL#*://}"
323-
printf '%s\n' "${protocol}://${GITHUB_ACTOR}:${PUSH_TOKEN}@${hostname}" >~/.git-credentials
323+
git credential approve <<EOF
324+
protocol=${protocol}
325+
host=${hostname}
326+
username=${GITHUB_ACTOR}
327+
password=${PUSH_TOKEN}
328+
EOF
324329
# Remove credential helper config on exit.
325-
trap -- '(set -x; rm -f -- ~/.git-credentials; git config --global --unset credential.helper || true)' EXIT
330+
trap -- '(set -x; git credential-cache exit; git config --local --unset credential.helper || true)' EXIT
326331
fi
327332
328333
(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/guppy-rs/guppy/releases
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/sourcefrog/cargo-mutants/releases
2+
https://github.com/sourcefrog/cargo-mutants/issues/215
3+
https://github.com/sourcefrog/cargo-mutants/issues/539
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// https://github.com/crate-ci/cargo-release/releases

0 commit comments

Comments
 (0)