Skip to content

Commit e13ea20

Browse files
authored
feat: update the github action to sign the commits of the pull request (#22)
1 parent 4040c0d commit e13ea20

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/release.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ jobs:
1717
name: Release version
1818
runs-on: ubuntu-24.04
1919
steps:
20+
- name: Install GPG
21+
run: sudo apt-get install -y gnupg
22+
23+
- name: Import GPG Key
24+
run: |
25+
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
26+
KEY_ID=$(gpg --list-secret-keys --with-colons | grep '^sec' | cut -d: -f5)
27+
echo "Using GPG key: $KEY_ID"
28+
env:
29+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
30+
31+
- name: Configure Git for GPG
32+
run: |
33+
git config --global user.name "GitHub CI Bot"
34+
git config --global user.email "github-ci[bot]@users.noreply.github.com"
35+
git config --global commit.gpgsign true
36+
git config --global user.signingkey "${{ secrets.GPG_KEY_ID }}"
37+
git config --global gpg.program gpg
38+
2039
- name: Generate token from GitHub App
2140
id: generate-token
2241
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
@@ -210,6 +229,7 @@ jobs:
210229
base: main
211230
branch: dev/${{ env.next_version }}
212231
delete-branch: true
232+
sign-commits: true
213233
title: "chore: update to ${{ env.next_version }}-dev version"
214234
body: "This PR was created automatically by GitHub Actions."
215235
labels: |

0 commit comments

Comments
 (0)