Skip to content

Commit ee55253

Browse files
committed
Update GPG Signing section in README
1 parent 4b8a201 commit ee55253

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,32 @@ The example below can be used as a starting point to generate a multiline commit
274274
commit_message: ${{ steps.commit_message_step.outputs.commit_message }}
275275
```
276276

277-
### Signing Commits & Other Git Command Line Options
277+
### Signing Commits
278278

279-
Using command lines options needs to be done manually for each workflow which you require the option enabled. So for example signing commits requires you to import the gpg signature each and every time. The following list of actions are worth checking out if you need to automate these tasks regularly.
279+
If you would like to sign your commits using a GPG key, you will need to use an additional action.
280+
You can use the [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) action and follow its setup instructions.
280281

281-
- [Import GPG Signature](https://github.com/crazy-max/ghaction-import-gpg) (Suggested by [TGTGamer](https://github.com/tgtgamer))
282+
As git-auto-commit by default does not use **your** username and email when creating a commit, you have to override these values in your workflow.
283+
284+
```yml
285+
- name: "Import GPG key"
286+
id: import-gpg
287+
uses: crazy-max/ghaction-import-gpg@v6
288+
with:
289+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
290+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
291+
git_user_signingkey: true
292+
git_commit_gpgsign: true
293+
294+
- name: "Commit and push changes"
295+
uses: stefanzweifel/git-auto-commit-action@v5
296+
with:
297+
commit_author: "${{ steps.import-gpg.outputs.name }} <${{ steps.import-gpg.outputs.email }}>"
298+
commit_user_name: ${{ steps.import-gpg.outputs.name }}
299+
commit_user_email: ${{ steps.import-gpg.outputs.email }}
300+
```
301+
302+
See discussion [#334](https://github.com/stefanzweifel/git-auto-commit-action/discussions/334) for details.
282303

283304
### Use in forks from private repositories
284305

0 commit comments

Comments
 (0)