Skip to content

Commit e50cb4f

Browse files
committed
Update README
1 parent 2624ea1 commit e50cb4f

File tree

1 file changed

+45
-5
lines changed

1 file changed

+45
-5
lines changed

README.md

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ If you are interested, [check out](https://git.io/Je09Y) my other :octocat: GitH
1313

1414
![Import GPG](.github/ghaction-import-gpg.png)
1515

16+
___
17+
18+
* [Features](#features)
19+
* [Prerequisites](#prerequisites)
20+
* [Usage](#usage)
21+
* [Workflow](#workflow)
22+
* [Sign commits](#sign-commits)
23+
* [Customizing](#customizing)
24+
* [inputs](#inputs)
25+
* [environment variables](#environment-variables)
26+
* [How can I help?](#how-can-i-help)
27+
* [License](#license)
28+
1629
## Features
1730

1831
* Works on Linux, MacOS and Windows [virtual environments](https://help.github.com/en/articles/virtual-environments-for-github-actions#supported-virtual-environments-and-hardware-resources)
@@ -21,7 +34,7 @@ If you are interested, [check out](https://git.io/Je09Y) my other :octocat: GitH
2134
* (Git) Enable signing for Git commits, tags and pushes
2235
* (Git) Configure and check committer info against GPG key
2336

24-
## Usage
37+
## Prerequisites
2538

2639
First, export the GPG private key as an ASCII armored version:
2740

@@ -31,6 +44,10 @@ gpg --armor --export-secret-key --output key.pgp joe@foo.bar
3144

3245
Copy the content of `key.pgp` file as a [`secret`](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) named `GPG_PRIVATE_KEY` for example. Create another secret with the `PASSPHRASE` if applicable.
3346

47+
## Usage
48+
49+
### Workflow
50+
3451
```yaml
3552
name: import-gpg
3653

@@ -49,10 +66,6 @@ jobs:
4966
name: Import GPG key
5067
id: import_gpg
5168
uses: crazy-max/ghaction-import-gpg@v1
52-
with:
53-
git_user_signingkey: true
54-
git_commit_gpgsign: true
55-
git_tag_gpgsign: true
5669
env:
5770
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
5871
PASSPHRASE: ${{ secrets.PASSPHRASE }}
@@ -62,6 +75,33 @@ jobs:
6275
echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}"
6376
echo "keyid: ${{ steps.import_gpg.outputs.keyid }}"
6477
echo "email: ${{ steps.import_gpg.outputs.email }}"
78+
```
79+
80+
### Sign commits
81+
82+
```yaml
83+
name: import-gpg
84+
85+
on:
86+
push:
87+
branches: master
88+
89+
jobs:
90+
sign-commit:
91+
runs-on: ubuntu-latest
92+
steps:
93+
-
94+
name: Checkout
95+
uses: actions/checkout@v2
96+
-
97+
name: Import GPG key
98+
uses: crazy-max/ghaction-import-gpg@v1
99+
with:
100+
git_user_signingkey: true
101+
git_commit_gpgsign: true
102+
env:
103+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
104+
PASSPHRASE: ${{ secrets.PASSPHRASE }}
65105
-
66106
name: Sign commit and push changes
67107
run: |

0 commit comments

Comments
 (0)