release-me-sh 0.11.3 → 0.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-me-sh",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "description": "Blazing fast minimal release workflow script written in Bash with plugins and presets support",
5
5
  "keywords": [
6
6
  "bash",
package/plugins/git.sh CHANGED
@@ -33,6 +33,7 @@ prepare() {
33
33
 
34
34
  SSH_PUBLIC_KEY_FILE=$(mktemp)
35
35
  printf "%s" "${SSH_PUBLIC_KEY}" >>"${SSH_PUBLIC_KEY_FILE}"
36
+ export SSH_PUBLIC_KEY_FILE
36
37
 
37
38
  if [ -n "${SSH_KEY_PASSPHRASE-}" ]; then
38
39
  SSH_ASKPASS_FILE=$(mktemp)
@@ -44,12 +45,8 @@ prepare() {
44
45
  log_verbose "Git SSH passphrase set"
45
46
  fi
46
47
 
47
- if ! ssh-add -L | grep -q "${SSH_PUBLIC_KEY-}"; then
48
- printf "%s" "${SSH_PRIVATE_KEY}" | base64 --decode | ssh-add -
49
- log_verbose "Git SSH key import loaded"
50
- else
51
- log_verbose "Git SSH key import skipped"
52
- fi
48
+ printf "%s" "${SSH_PRIVATE_KEY}" | base64 --decode | ssh-add -
49
+ log_verbose "Git SSH key import loaded"
53
50
 
54
51
  git config --local commit.gpgsign true
55
52
  git config --local user.signingkey "${SSH_PUBLIC_KEY_FILE}"
@@ -90,13 +87,19 @@ cleanup() {
90
87
  fi
91
88
 
92
89
  log_verbose "Git GPG config cleanup"
93
- elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PUB_KEY-}" ]; then
90
+ elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PRIVATE_KEY-}" ] && [ -n "${SSH_PUBLIC_KEY-}" ]; then
94
91
  git config --local --unset commit.gpgsign true
95
- git config --local --unset user.signingkey "${SSH_PUB_KEY}"
92
+ git config --local --unset user.signingkey "${SSH_PUBLIC_KEY_FILE}"
96
93
  git config --local --unset tag.forceSignAnnotated true
97
94
  git config --local --unset gpg.format ssh
98
95
 
99
96
  ssh-add -L | grep -F "${SSH_PUBLIC_KEY-}" | ssh-add -d -
97
+ rm -rf "${SSH_PUBLIC_KEY_FILE}"
98
+
99
+ unset SSH_PUBLIC_KEY_FILE
100
+ unset SSH_PRIVATE_KEY
101
+ unset SSH_PUBLIC_KEY
102
+
100
103
  log_verbose "Git SSH sign is unset"
101
104
  fi
102
105
 
@@ -114,7 +117,7 @@ release() {
114
117
  if [ -z "${GPG_NO_SIGN-}" ] && [ -n "${GPG_KEY-}" ] && [ -n "${GPG_KEY_ID-}" ]; then
115
118
  git tag --sign "${NEXT_RELEASE_TAG-}" "${CHECKOUT_SHA}" --message "Release, tag and sign ${NEXT_RELEASE_TAG}"
116
119
  log "Created GPG signed Git tag [${NEXT_RELEASE_TAG}]!"
117
- elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PUB_KEY-}" ]; then
120
+ elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PUBLIC_KEY-}" ]; then
118
121
  git tag --sign "${NEXT_RELEASE_TAG}" "${CHECKOUT_SHA}" --message "Release, tag and sign ${NEXT_RELEASE_TAG}"
119
122
  log "Created SSH signed Git tag [${NEXT_RELEASE_TAG}]!"
120
123
  else
@@ -33,12 +33,7 @@ prepare() {
33
33
 
34
34
  SSH_PUBLIC_KEY_FILE=$(mktemp)
35
35
  printf "%s" "${SSH_PUBLIC_KEY}" >>"${SSH_PUBLIC_KEY_FILE}"
36
-
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"
36
+ export SSH_PUBLIC_KEY_FILE
42
37
 
43
38
  if [ -n "${SSH_KEY_PASSPHRASE-}" ]; then
44
39
  SSH_ASKPASS_FILE=$(mktemp)
@@ -50,12 +45,14 @@ prepare() {
50
45
  log_verbose "Git SSH passphrase set"
51
46
  fi
52
47
 
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
48
+ printf "%s" "${SSH_PRIVATE_KEY}" | base64 --decode | ssh-add -
49
+ log_verbose "Git SSH key import loaded"
50
+
51
+ git config --local commit.gpgsign true
52
+ git config --local user.signingkey "${SSH_PUBLIC_KEY_FILE}"
53
+ git config --local tag.forceSignAnnotated true
54
+ git config --local gpg.format ssh
55
+ log_verbose "Git SSH sign key is set"
59
56
 
60
57
  if [ -n "${SSH_KEY_PASSPHRASE-}" ]; then
61
58
  rm -rf "${SSH_ASKPASS}"
@@ -90,13 +87,19 @@ cleanup() {
90
87
  fi
91
88
 
92
89
  log_verbose "Git GPG config cleanup"
93
- elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PUB_KEY-}" ]; then
90
+ elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PRIVATE_KEY-}" ] && [ -n "${SSH_PUBLIC_KEY-}" ]; then
94
91
  git config --local --unset commit.gpgsign true
95
- git config --local --unset user.signingkey "${SSH_PUB_KEY}"
92
+ git config --local --unset user.signingkey "${SSH_PUBLIC_KEY_FILE}"
96
93
  git config --local --unset tag.forceSignAnnotated true
97
94
  git config --local --unset gpg.format ssh
98
95
 
99
96
  ssh-add -L | grep -F "${SSH_PUBLIC_KEY-}" | ssh-add -d -
97
+ rm -rf "${SSH_PUBLIC_KEY_FILE}"
98
+
99
+ unset SSH_PUBLIC_KEY_FILE
100
+ unset SSH_PRIVATE_KEY
101
+ unset SSH_PUBLIC_KEY
102
+
100
103
  log_verbose "Git SSH sign is unset"
101
104
  fi
102
105
 
@@ -129,7 +132,7 @@ release() {
129
132
 
130
133
  if [ -z "${GPG_NO_SIGN-}" ] && [ -n "${GPG_KEY-}" ] && [ -n "${GPG_KEY_ID-}" ]; then
131
134
  git commit --sign -m "chore(${PKG_NAME}): update \`package.json\` version to ${NEXT_RELEASE_VERSION-}" --no-verify
132
- elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PUB_KEY-}" ]; then
135
+ elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PUBLIC_KEY-}" ]; then
133
136
  git commit --sign -m "chore(${PKG_NAME}): update \`package.json\` version to ${NEXT_RELEASE_VERSION}" --no-verify
134
137
  else
135
138
  git commit --no-gpg-sign -m "chore(${PKG_NAME}): update \`package.json\` version to ${NEXT_RELEASE_VERSION}" --no-verify
@@ -137,7 +140,7 @@ release() {
137
140
  else
138
141
  if [ -z "${GPG_NO_SIGN-}" ] && [ -n "${GPG_KEY-}" ] && [ -n "${GPG_KEY_ID-}" ]; then
139
142
  git commit --sign -m "chore(ci): update \`package.json\` version to ${NEXT_RELEASE_VERSION}" --no-verify
140
- elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PUB_KEY-}" ]; then
143
+ elif [ -z "${SSH_NO_SIGN-}" ] && [ -n "${SSH_PUBLIC_KEY-}" ]; then
141
144
  git commit --sign -m "chore(ci): update \`package.json\` version to ${NEXT_RELEASE_VERSION}" --no-verify
142
145
  else
143
146
  git commit --no-gpg-sign -m "chore(ci): update \`package.json\` version to ${NEXT_RELEASE_VERSION}" --no-verify