Skip to content

Commit 96a0d49

Browse files
committed
chore: add GPG signing test workflow
1 parent 18a71f3 commit 96a0d49

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/test-gpg.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test GPG Signing
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test-gpg:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Import GPG key
16+
uses: crazy-max/ghaction-import-gpg@v6
17+
with:
18+
gpg_private_key: ${{ secrets.GHA_BOT_GPG }}
19+
git_user_signingkey: true
20+
git_commit_gpgsign: true
21+
22+
- name: Configure git
23+
run: |
24+
git config user.name "GitHub Actions"
25+
git config user.email "github-actions[bot]@users.noreply.github.com"
26+
27+
- name: Create test commit
28+
run: |
29+
echo "test" > test-gpg.txt
30+
git add test-gpg.txt
31+
git commit -m "test: GPG signing"
32+
git log -1 --show-signature
33+
34+
- name: Verify commit is signed
35+
run: |
36+
if git log -1 --format="%G?" | grep -q "G"; then
37+
echo "✅ Commit is properly signed!"
38+
else
39+
echo "❌ Commit is NOT signed!"
40+
exit 1
41+
fi
42+
43+
- name: Cleanup
44+
if: always()
45+
run: |
46+
git reset --hard HEAD~1
47+
rm -f test-gpg.txt

0 commit comments

Comments
 (0)