Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed May 11, 2020
1 parent 2624ea1 commit e50cb4f
Showing 1 changed file with 45 additions and 5 deletions.
50 changes: 45 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ If you are interested, [check out](https://git.io/Je09Y) my other :octocat: GitH

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

___

* [Features](#features)
* [Prerequisites](#prerequisites)
* [Usage](#usage)
* [Workflow](#workflow)
* [Sign commits](#sign-commits)
* [Customizing](#customizing)
* [inputs](#inputs)
* [environment variables](#environment-variables)
* [How can I help?](#how-can-i-help)
* [License](#license)

## Features

* 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)
Expand All @@ -21,7 +34,7 @@ If you are interested, [check out](https://git.io/Je09Y) my other :octocat: GitH
* (Git) Enable signing for Git commits, tags and pushes
* (Git) Configure and check committer info against GPG key

## Usage
## Prerequisites

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

Expand All @@ -31,6 +44,10 @@ gpg --armor --export-secret-key --output key.pgp [email protected]

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.

## Usage

### Workflow

```yaml
name: import-gpg

Expand All @@ -49,10 +66,6 @@ jobs:
name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v1
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
Expand All @@ -62,6 +75,33 @@ jobs:
echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}"
echo "keyid: ${{ steps.import_gpg.outputs.keyid }}"
echo "email: ${{ steps.import_gpg.outputs.email }}"
```
### Sign commits
```yaml
name: import-gpg

on:
push:
branches: master

jobs:
sign-commit:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v1
with:
git_user_signingkey: true
git_commit_gpgsign: true
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
-
name: Sign commit and push changes
run: |
Expand Down

0 comments on commit e50cb4f

Please sign in to comment.