@@ -24,22 +24,30 @@ jobs:
24
24
current_year=$(date +%Y)
25
25
echo "CURRENT_YEAR=${current_year}" >> $GITHUB_ENV
26
26
27
- - name : Setup GPG
27
+ - name : Import GPG key
28
+ run : echo $GPG_KEY | base64 --decode | gpg --batch --import
29
+ env :
30
+ GPG_KEY : ${{ secrets.GPG_KEY }}
31
+
32
+ - name : Add the custom gpg siging program that passes the passphrase to the gpg CLI
28
33
run : |
29
- echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
30
- echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
31
- gpg --batch --passphrase "${{ secrets.GPG_PASSPHRASE }}" --list-keys
34
+ rm -rf /tmp/gpg.sh
35
+ echo '#!/bin/bash' >> /tmp/gpg.sh
36
+ echo 'gpg --batch --pinentry-mode=loopback --passphrase $GPG_KEY_PASSPHRASE $@' >> /tmp/gpg.sh
37
+ chmod +x /tmp/gpg.sh
32
38
33
39
- name : Create new branch and commit changes
34
40
env :
35
41
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36
42
CURRENT_YEAR : ${{ env.CURRENT_YEAR }}
43
+ GPG_KEY_ID : ${{ secrets.GPG_KEY_ID }}
37
44
run : |
38
45
# Configure Git for the action
39
- git config --local user.email "action@github .com"
40
- git config --local user.name "GitHub Action "
46
+ git config --local user.email "pooya_parsa_dadashi@yahoo .com"
47
+ git config --local user.name "Pooya Parsa Dadashi "
41
48
git config --local commit.gpgsign true
42
- git config --local user.signingkey ${{ secrets.GPG_KEY_ID }}
49
+ git config --local user.signingkey $GPG_KEY_ID
50
+ git config --local gpg.program /tmp/gpg.sh
43
51
44
52
45
53
# Create a new branch for the changes
51
59
git add . # Ensure all changes are added
52
60
git commit -m "docs: update copyright year to ${{ env.CURRENT_YEAR }}"
53
61
git push -f origin $BRANCH_NAME
62
+
54
63
55
64
- name : Create Pull Request Github CLI
56
65
env :
0 commit comments