Skip to content

Commit 8eb5841

Browse files
adam-grant-hendryHendry, Adam
and
Hendry, Adam
authored
feat(entrypoing.sh): add gpg sign
fix: check_consistency beign ignored * feat(action.yml): add `gpg` inputs Add input for GPG key and passphrase and whether or not to sign. * feat(entrypoing.sh): add `gpg` sign Add `-s` to `bump` command if `gpg_sign` is 'true'. * fix(entrypoint.sh): set git config Set `gpg.program`, `commit.gpgsign`, and `tag.gpgsign`. * fix(gpg): add `signingkey` Git requires `signingkey` to sign commits and tags. feat(debug): add option for debug output * fix(signingkey): specify UID Git takes the UID for the signing key, not the key itself. * fix(entrypoint.sh): add `gpg.program` Add `gpg.program` to Git config. * feat(entrypoint.sh): write `gpg` script Use bash script to configure the GPG agent, import keys, set the passphrase, and configure Git. * fix(entrypoint.sh): replace `systemctl` Use `service` as `systemctl` is not on GitHub Actions runners. * fix(entrypoint.sh): remove `sudo` * Revert "fix(entrypoint.sh): replace `systemctl`" This reverts commit 2cf68aa. * Revert "feat(entrypoint.sh): write `gpg` script" This reverts commit a1c8571. * Revert "fix(entrypoint.sh): add `gpg.program`" This reverts commit 94d316f. * fix(entrypoint.sh): remove signing commits Only sign tags. It may be that `commitizen` only supports signing tags. See: commitizen-tools/commitizen#616 * fix(entrypoint.sh): remove signing configs Remove `tag.gpgsign` and `commit.gpgsign` from local Git config. * fix(entrypoint.sh): remove `--gpg-sign` See if Git will sign for us instead of through `cz`. * fix(entrypoint.sh): add `commit.gpgsign` Remove specifying `gpg.program` and add `commit.gpgsign` back. * fix(entrypoint.sh): add `gpg-sign` back Add `--gpg-sign` back to `commitizen`. * fix(entrypoint.sh): move `--gpg-sign` after bump Switch `--gpg-sign` applies to `bump` subcommand. * fix(entrypoint.sh): move `--debug` Move `--debug` switch to after `bump` command. * Revert "fix(entrypoint.sh): move `--debug`" This reverts commit e543aff. * fix(entrypoint.sh): add `commit.gpgsign` * ci(test): add `gpg -K` to stdout * ci(test): more printouts * ci(test): even more printouts * ci(test): print which `gpg` is running * ci(test): let `import-gpg` setup `gpg` * ci(test): print `gpg --version` * feat(ci): run in docker container * Revert "feat(ci): run in docker container" This reverts commit 3b2cae5. Closes: #50 Closes: #53 Co-authored-by: Hendry, Adam <adam.hendry@metronic.com>
1 parent e62ece2 commit 8eb5841

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Diff for: action.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ inputs:
7272
description: "Manually specify the desired increment"
7373
required: false
7474
check_consistency:
75-
default: false
75+
default: 'false'
7676
description: "check consistency among versions defined in commitizen configuration and version_files"
7777
required: false
78+
gpg_sign:
79+
description: >
80+
If true, use GPG to sign commits and tags (for git operations). Requires separate
81+
setup of GPG key and passphrase in GitHub Actions (e.g. with the action
82+
crazy-max/ghaction-import-gpg)
83+
required: false
84+
default: "false"
85+
debug:
86+
description: "If true, prints debug output to GitHub Actions stdout."
87+
required: false
88+
default: "false"

Diff for: entrypoint.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

5+
gpg --version
6+
57
if [[ -z $INPUT_GITHUB_TOKEN ]]; then
68
echo 'Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}".' >&2
79
exit 1
@@ -29,10 +31,16 @@ echo "Commitizen version: $(cz version)"
2931
PREV_REV="$(cz version --project)"
3032

3133
CZ_CMD=('cz')
34+
if [[ $INPUT_DEBUG == 'true' ]]; then
35+
CZ_CMD+=('--debug')
36+
fi
3237
if [[ $INPUT_NO_RAISE ]]; then
3338
CZ_CMD+=('--no-raise' "$INPUT_NO_RAISE")
3439
fi
3540
CZ_CMD+=('bump' '--yes')
41+
if [[ $INPUT_GPG_SIGN == 'true' ]]; then
42+
CZ_CMD+=('--gpg-sign')
43+
fi
3644
if [[ $INPUT_DRY_RUN == 'true' ]]; then
3745
CZ_CMD+=('--dry-run')
3846
fi

0 commit comments

Comments
 (0)