POSIX-compliant inputs names (#109)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-09-05 01:12:28 +02:00 committed by GitHub
parent e8a90f2bec
commit 3a2a627ae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 52 deletions

View file

@ -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: |
@ -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: |

View file

@ -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
@ -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
@ -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: |
@ -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

View file

@ -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:

16
dist/index.js generated vendored
View file

@ -42,15 +42,15 @@ const command_1 = __webpack_require__(351);
function getInputs() {
return __awaiter(this, void 0, void 0, function* () {
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') || '.'
};
});

View file

@ -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') || '.'
};
}