Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POSIX-compliant inputs names #109

Merged
merged 1 commit into from Sep 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Expand Up @@ -45,13 +45,13 @@ jobs:
id: import_gpg
uses: ./
with:
gpg-private-key: ${{ steps.test.outputs.pgp }}
gpg_private_key: ${{ steps.test.outputs.pgp }}
passphrase: ${{ steps.test.outputs.passphrase }}
git-config-global: ${{ matrix.global }}
git-user-signingkey: true
git-commit-gpgsign: true
git-tag-gpgsign: true
git-push-gpgsign: if-asked
git_config_global: ${{ matrix.global }}
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
git_push_gpgsign: if-asked
-
name: GPG user IDs
run: |
Expand Down Expand Up @@ -87,12 +87,12 @@ jobs:
id: import_gpg
uses: ./
with:
gpg-private-key: ${{ steps.test.outputs.pgp-base64 }}
gpg_private_key: ${{ steps.test.outputs.pgp-base64 }}
passphrase: ${{ steps.test.outputs.passphrase }}
git-user-signingkey: true
git-commit-gpgsign: true
git-tag-gpgsign: true
git-push-gpgsign: if-asked
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
git_push_gpgsign: if-asked
-
name: GPG user IDs
run: |
Expand Down
29 changes: 15 additions & 14 deletions README.md
Expand Up @@ -28,7 +28,7 @@ ___

## 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)
* 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)
* Allow to seed the internal cache of `gpg-agent` with provided passphrase
* Purge imported GPG key, cache information and kill agent from runner
* (Git) Enable signing for Git commits, tags and pushes
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
-
name: GPG user IDs
Expand Down Expand Up @@ -110,10 +110,10 @@ jobs:
name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git-user-signingkey: true
git-commit-gpgsign: true
git_user_signingkey: true
git_commit_gpgsign: true
-
name: Sign commit and push changes
run: |
Expand All @@ -131,18 +131,19 @@ Following inputs can be used as `step.with` keys

| Name | Type | Description |
|---------------------------------------|---------|------------------------------------------------|
| `gpg-private-key` | String | GPG private key exported as an ASCII armored version or its base64 encoding (**required**) |
| `gpg_private_key` | String | GPG private key exported as an ASCII armored version or its base64 encoding (**required**) |
| `passphrase` | String | Passphrase of the GPG private key |
| `git-config-global` | Bool | Set Git config global (default `false`) |
| `git-user-signingkey` | Bool | Set GPG signing keyID for this Git repository (default `false`) |
| `git-commit-gpgsign`**¹** | Bool | Sign all commits automatically. (default `false`) |
| `git-tag-gpgsign`**¹** | Bool | Sign all tags automatically. (default `false`) |
| `git-push-gpgsign`**¹** | String | Sign all pushes automatically. (default `if-asked`) |
| `git-committer-name`**¹** | String | Set commit author's name (defaults to the name associated with the GPG key) |
| `git-committer-email`**¹** | String | Set commit author's email (defaults to the email address associated with the GPG key) |
| `git_config_global` | Bool | Set Git config global (default `false`) |
| `git_user_signingkey` | Bool | Set GPG signing keyID for this Git repository (default `false`) |
| `git_commit_gpgsign` | Bool | Sign all commits automatically. (default `false`) |
| `git_tag_gpgsign` | Bool | Sign all tags automatically. (default `false`) |
| `git_push_gpgsign` | String | Sign all pushes automatically. (default `if-asked`) |
| `git_committer_name` | String | Set commit author's name (defaults to the name associated with the GPG key) |
| `git_committer_email` | String | Set commit author's email (defaults to the email address associated with the GPG key) |
| `workdir` | String | Working directory (below repository root) (default `.`) |

> **¹** `git-user-signingkey` needs to be enabled for these inputs to be used.
> `git_user_signingkey` needs to be enabled for `git_commit_gpgsign`, `git_tag_gpgsign`,
> `git_push_gpgsign`, `git_committer_name`, `git_committer_email` inputs.
### outputs

Expand Down
22 changes: 11 additions & 11 deletions action.yml
Expand Up @@ -7,36 +7,36 @@ branding:
icon: 'lock'

inputs:
gpg-private-key:
gpg_private_key:
description: 'GPG private key exported as an ASCII armored version or its base64 encoding'
required: true
passphrase:
description: 'Passphrase of the GPG private key'
required: false
git-config-global:
git_config_global:
description: 'Set Git config global'
default: 'false'
required: false
git-user-signingkey:
git_user_signingkey:
description: 'Set GPG signing keyID for this Git repository'
default: 'false'
required: false
git-commit-gpgsign:
description: 'Sign all commits automatically. git-user-signingkey needs to be enabled'
git_commit_gpgsign:
description: 'Sign all commits automatically. git_user_signingkey needs to be enabled'
default: 'false'
required: false
git-tag-gpgsign:
description: 'Sign all tags automatically. git-user-signingkey needs to be enabled'
git_tag_gpgsign:
description: 'Sign all tags automatically. git_user_signingkey needs to be enabled'
default: 'false'
required: false
git-push-gpgsign:
description: 'Sign all pushes automatically. git-user-signingkey needs to be enabled'
git_push_gpgsign:
description: 'Sign all pushes automatically. git_user_signingkey needs to be enabled'
default: 'if-asked'
required: false
git-committer-name:
git_committer_name:
description: 'Commit author''s name'
required: false
git-committer-email:
git_committer_email:
description: 'Commit author''s email'
required: false
workdir:
Expand Down
16 changes: 8 additions & 8 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/context.ts
Expand Up @@ -16,15 +16,15 @@ export interface Inputs {

export async function getInputs(): Promise<Inputs> {
return {
gpgPrivateKey: core.getInput('gpg-private-key', {required: true}),
gpgPrivateKey: core.getInput('gpg_private_key', {required: true}),
passphrase: core.getInput('passphrase'),
gitConfigGlobal: core.getBooleanInput('git-config-global'),
gitUserSigningkey: core.getBooleanInput('git-user-signingkey'),
gitCommitGpgsign: core.getBooleanInput('git-commit-gpgsign'),
gitTagGpgsign: core.getBooleanInput('git-tag-gpgsign'),
gitPushGpgsign: core.getInput('git-push-gpgsign') || 'if-asked',
gitCommitterName: core.getInput('git-committer-name'),
gitCommitterEmail: core.getInput('git-committer-email'),
gitConfigGlobal: core.getBooleanInput('git_config_global'),
gitUserSigningkey: core.getBooleanInput('git_user_signingkey'),
gitCommitGpgsign: core.getBooleanInput('git_commit_gpgsign'),
gitTagGpgsign: core.getBooleanInput('git_tag_gpgsign'),
gitPushGpgsign: core.getInput('git_push_gpgsign') || 'if-asked',
gitCommitterName: core.getInput('git_committer_name'),
gitCommitterEmail: core.getInput('git_committer_email'),
workdir: core.getInput('workdir') || '.'
};
}
Expand Down