Skip to content

Commit 1de9291

Browse files
committed
feat!: use default sh shell instead of bash
* improve compatibility across environment * avoid process substitutions and `bash` specifics when GitHub Actions falls back to using `sh` anyway Fixes #4
1 parent e0d01f9 commit 1de9291

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

action.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,23 @@ runs:
5757
fi
5858
5959
- name: Import GPG Key
60-
shell: bash
60+
shell: sh
6161
run: |
62-
echo -n ${{ inputs.gpg-sign-key }} | base64 --decode \
63-
| gpg --pinentry-mode loopback \
64-
--passphrase-file <(echo ${{ inputs.gpg-passphrase }}) \
65-
--import
66-
GPG_FINGERPRINT=$(gpg -K --with-fingerprint \
67-
| sed -n 4p | sed -e 's/ *//g')
62+
echo ${{ inputs.gpg-passphrase }} > passfile
63+
echo -n ${{ inputs.gpg-sign-key }} | base64 --decode > signkey
64+
gpg --pinentry-mode loopback \
65+
--passphrase-file passfile \
66+
--import signkey
67+
rm passfile signkey
68+
GPG_FINGERPRINT=$( \
69+
gpg -K --with-fingerprint \
70+
| sed -n 4p \
71+
| sed -e 's/ *//g' \
72+
)
6873
echo "${GPG_FINGERPRINT}:6:" | gpg --import-ownertrust
6974
7075
- name: Preset Passphrase In GPG Agent
71-
shell: bash
76+
shell: sh
7277
run: |
7378
GPG_KEYGRIP=`gpg --with-keygrip -K \
7479
| sed -n '/[S]/{n;p}' \
@@ -77,20 +82,21 @@ runs:
7782
GPG_PASSPHRASE_HEX=`echo -n ${{ inputs.gpg-passphrase }} \
7883
| od -A n -t x1 \
7984
| tr -d ' ' | tr -d '\n'`
80-
echo "PRESET_PASSPHRASE $GPG_KEYGRIP -1 $GPG_PASSPHRASE_HEX" | gpg-connect-agent
85+
echo "PRESET_PASSPHRASE $GPG_KEYGRIP -1 $GPG_PASSPHRASE_HEX" \
86+
| gpg-connect-agent
8187
8288
- name: Configure Git
83-
shell: bash
89+
shell: sh
8490
run: |
8591
export CI_SIGNINGKEY_ID=$( \
8692
gpg --list-signatures --with-colons \
8793
| grep 'sig' \
88-
| grep ${{ inputs.git-email }} \
94+
| grep ${{ inputs.git-email }} \
8995
| head -n 1 \
9096
| cut -d':' -f5 \
9197
)
9298
git config --global user.name "${{ inputs.git-username }}"
9399
git config --global user.email "${{ inputs.git-email }}"
94100
git config --global user.signingkey $CI_SIGNINGKEY_ID
95101
git config --global commit.gpgsign true
96-
git config --global tag.gpgsign true
102+
git config --global tag.gpgsign true

0 commit comments

Comments
 (0)