Skip to content

Commit 39f1721

Browse files
Import GPG key for commit signing in workflow
Added GPG key import step for signing commits in the workflow.
1 parent 9ed49da commit 39f1721

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/make_blog_draft_pr.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ jobs:
4242
uses: actions/checkout@v3
4343
with:
4444
ref: prod
45-
45+
46+
- name: Import GPG key
47+
run: |
48+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --batch
49+
git config --global user.signingkey ${{ secrets.GPG_KEY_ID }}
50+
git config --global commit.gpgsign true
51+
4652
- name: Create new branch ${{ inputs.version }}-post
4753
if: false
4854
run: git checkout -b ${{ inputs.version }}-post
@@ -63,11 +69,12 @@ jobs:
6369
run: |
6470
git config user.name github-actions
6571
git config user.email github-actions@github.com
72+
git config commit.gpgsign true
6673
git add -A
67-
git commit -m ${{ inputs.version }} --author "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
74+
git commit -S -m ${{ inputs.version }} --author "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
6875
git push origin prod:${{ inputs.version }}-post
6976
echo "pr-url=$(gh pr create --base draft --head ${{ inputs.version }}-post --title "${{ inputs.version }} draft" --assignee ${{ github.actor }} --body "After this PR is merged, preview at draft site:&nbsp;${{ steps.gen-url.outputs.draft-url }}")" >> $GITHUB_OUTPUT
70-
77+
7178
- name: Create PR using action from marketplace
7279
if: false
7380
id: create-pr-old

0 commit comments

Comments
 (0)