Skip to content

Commit ea97827

Browse files
committed
ci:Add GPG signing and language file handling to update-hashes workflow
1 parent 07162b4 commit ea97827

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

.github/workflows/update-hashes.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,35 @@ jobs:
103103
git diff openlist/Makefile
104104
fi
105105
106-
- name: Configure Git
107-
if: steps.changes.outputs.has_changes == 'true'
106+
- name: Check for changes and stage
107+
id: verify-changed-files
108+
run: |
109+
cp -f ./backend/lang/*.json ./src/lang/en/ 2>/dev/null || :
110+
if git diff --quiet HEAD -- src/lang/en/; then
111+
echo "No changes detected in src/lang/en/"
112+
echo "changed=false" >> $GITHUB_OUTPUT
113+
else
114+
echo "Changes detected in src/lang/en/"
115+
git add src/lang/en/
116+
echo "changed=true" >> $GITHUB_OUTPUT
117+
fi
118+
119+
- name: Import GPG key
120+
if: steps.verify-changed-files.outputs.changed == 'true'
121+
uses: crazy-max/ghaction-import-gpg@v6
122+
with:
123+
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
124+
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}
125+
git_config_global: true
126+
git_user_signingkey: true
127+
git_commit_gpgsign: true
128+
git_tag_gpgsign: true
129+
130+
- name: Setup CI Bot
131+
if: steps.verify-changed-files.outputs.changed == 'true'
108132
run: |
109-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
110-
git config --local user.name "github-actions[bot]"
133+
git config --global user.name "The OpenList Bot"
134+
git config --global user.email "bot@openlist.team"
111135
112136
- name: Commit and Push Changes
113137
if: steps.changes.outputs.has_changes == 'true'

0 commit comments

Comments
 (0)