Skip to content

Commit dc8537c

Browse files
committed
fix(plugins/npm-post): on GitHub it could be already saved
1 parent 88a6afc commit dc8537c

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

plugins/npm-post.sh

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ prepare() {
3434
SSH_PUBLIC_KEY_FILE=$(mktemp)
3535
printf "%s" "${SSH_PUBLIC_KEY}" >>"${SSH_PUBLIC_KEY_FILE}"
3636

37-
git config --local commit.gpgsign true
38-
git config --local user.signingkey "${SSH_PUBLIC_KEY_FILE}"
39-
git config --local tag.forceSignAnnotated true
40-
git config --local gpg.format ssh
41-
log_verbose "Git SSH sign key is set"
42-
4337
if [ -n "${SSH_KEY_PASSPHRASE-}" ]; then
4438
SSH_ASKPASS_FILE=$(mktemp)
4539
chmod 0755 "${SSH_ASKPASS_FILE}"
@@ -50,12 +44,14 @@ prepare() {
5044
log_verbose "Git SSH passphrase set"
5145
fi
5246

53-
if ! ssh-add -L | grep -q "${SSH_PUBLIC_KEY-}"; then
54-
printf "%s" "${SSH_PRIVATE_KEY}" | base64 --decode | ssh-add -
55-
log_verbose "Git SSH key import loaded"
56-
else
57-
log_verbose "Git SSH key import skipped"
58-
fi
47+
printf "%s" "${SSH_PRIVATE_KEY}" | base64 --decode | ssh-add -
48+
log_verbose "Git SSH key import loaded"
49+
50+
git config --local commit.gpgsign true
51+
git config --local user.signingkey "${SSH_PUBLIC_KEY_FILE}"
52+
git config --local tag.forceSignAnnotated true
53+
git config --local gpg.format ssh
54+
log_verbose "Git SSH sign key is set"
5955

6056
if [ -n "${SSH_KEY_PASSPHRASE-}" ]; then
6157
rm -rf "${SSH_ASKPASS}"

0 commit comments

Comments
 (0)