File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments