Skip to content

Commit 9c21b65

Browse files
authored
Update auto-update-copyright.yml
1 parent 410b558 commit 9c21b65

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/auto-update-copyright.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,30 @@ jobs:
2424
current_year=$(date +%Y)
2525
echo "CURRENT_YEAR=${current_year}" >> $GITHUB_ENV
2626
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
2833
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
3238
3339
- name: Create new branch and commit changes
3440
env:
3541
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3642
CURRENT_YEAR: ${{ env.CURRENT_YEAR }}
43+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
3744
run: |
3845
# 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"
4148
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
4351
4452
4553
# Create a new branch for the changes
@@ -51,6 +59,7 @@ jobs:
5159
git add . # Ensure all changes are added
5260
git commit -m "docs: update copyright year to ${{ env.CURRENT_YEAR }}"
5361
git push -f origin $BRANCH_NAME
62+
5463
5564
- name: Create Pull Request Github CLI
5665
env:

0 commit comments

Comments
 (0)