Skip to content

Commit 1a5925b

Browse files
authored
Import Commit Signing Keys for Workflow Commits (#116)
* cd.yml: Import commit signing key, remove force pushes of tags * ci-comment.yml: Import commit-signing key
1 parent db1ad07 commit 1a5925b

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

.github/workflows/cd.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,22 @@ jobs:
6161
# is of the form `<model>@git.<version>`.
6262
run: echo "name=$(yq '${{ env.SPACK_YAML_MODEL_YQ }} | split("@git.") | .[1]' spack.yaml)" >> $GITHUB_OUTPUT
6363

64+
- name: Import Commit-Signing Key
65+
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
66+
with:
67+
gpg_private_key: ${{ secrets.GH_ACTIONS_BOT_GPG_PRIVATE_KEY }}
68+
passphrase: ${{ secrets.GH_ACTIONS_BOT_GPG_PASSPHRASE }}
69+
git_config_global: true
70+
git_committer_name: ${{ vars.GH_ACTIONS_BOT_GIT_USER_NAME }}
71+
git_committer_email: ${{ vars.GH_ACTIONS_BOT_GIT_USER_EMAIL }}
72+
git_user_signingkey: true
73+
git_commit_gpgsign: true
74+
git_tag_gpgsign: true
75+
6476
- name: Push Tag
65-
# NOTE: Regarding the config user.name/user.email, see https://github.com/actions/checkout/pull/1184
6677
run: |
67-
git config user.name ${{ vars.GH_ACTIONS_BOT_GIT_USER_NAME }}
68-
git config user.email ${{ vars.GH_ACTIONS_BOT_GIT_USER_EMAIL }}
69-
git tag ${{ steps.tag.outputs.name }} --force
70-
git push --tags --force
78+
git tag ${{ steps.tag.outputs.name }}
79+
git push --tags
7180
7281
deploy-release:
7382
name: Deploy Release

.github/workflows/ci-comment.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,20 @@ jobs:
9191
versioning-scheme: calver-minor
9292
bump-type: ${{ steps.setup.outputs.bump }}
9393

94+
- name: Import Commit-Signing Key
95+
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
96+
with:
97+
gpg_private_key: ${{ secrets.GH_ACTIONS_BOT_GPG_PRIVATE_KEY }}
98+
passphrase: ${{ secrets.GH_ACTIONS_BOT_GPG_PASSPHRASE }}
99+
git_config_global: true
100+
git_committer_name: ${{ vars.GH_ACTIONS_BOT_GIT_USER_NAME }}
101+
git_committer_email: ${{ vars.GH_ACTIONS_BOT_GIT_USER_EMAIL }}
102+
git_user_signingkey: true
103+
git_commit_gpgsign: true
104+
git_tag_gpgsign: true
105+
94106
- name: Update, Commit and Push the Bump
95107
run: |
96-
git config user.name ${{ vars.GH_ACTIONS_BOT_GIT_USER_NAME }}
97-
git config user.email ${{ vars.GH_ACTIONS_BOT_GIT_USER_EMAIL }}
98-
99108
yq -i '${{ env.SPACK_YAML_MODEL_YQ }} = "${{ inputs.root-sbd }}@git.${{ steps.bump.outputs.after }}"' spack.yaml
100109
yq -i '${{ env.SPACK_YAML_MODEL_PROJECTION_YQ }} = "{name}/${{ steps.bump.outputs.after }}"' spack.yaml
101110
git add spack.yaml

0 commit comments

Comments
 (0)