Skip to content

Commit 6a40bc6

Browse files
Configure SSH signing for commits in workflow
Add SSH commit signing configuration to workflow
1 parent 9ed49da commit 6a40bc6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/make_blog_draft_pr.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ jobs:
4242
uses: actions/checkout@v3
4343
with:
4444
ref: prod
45+
46+
- name: Configure SSH commit signing
47+
run: |
48+
mkdir -p ~/.ssh
49+
echo "${{ secrets.SSH_SIGNING_KEY }}" > ~/.ssh/signing_key
50+
chmod 600 ~/.ssh/signing_key
51+
git config --global gpg.format ssh
52+
git config --global user.signingkey ~/.ssh/signing_key
53+
git config --global commit.gpgsign true
4554
4655
- name: Create new branch ${{ inputs.version }}-post
4756
if: false
@@ -64,7 +73,7 @@ jobs:
6473
git config user.name github-actions
6574
git config user.email github-actions@github.com
6675
git add -A
67-
git commit -m ${{ inputs.version }} --author "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
76+
git commit -S -m ${{ inputs.version }} --author "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
6877
git push origin prod:${{ inputs.version }}-post
6978
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
7079

0 commit comments

Comments
 (0)