Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 35d0a04

Browse files
adam-grant-hendryHendry, Adam
authored andcommitted
feat(entrypoing.sh): add gpg sign
fix: check_consistency beign ignored Add input for GPG key and passphrase and whether or not to sign. Add `-s` to `bump` command if `gpg_sign` is 'true'. Set `gpg.program`, `commit.gpgsign`, and `tag.gpgsign`. Git requires `signingkey` to sign commits and tags. feat(debug): add option for debug output Git takes the UID for the signing key, not the key itself. Add `gpg.program` to Git config. Use bash script to configure the GPG agent, import keys, set the passphrase, and configure Git. Use `service` as `systemctl` is not on GitHub Actions runners. This reverts commit 2cf68aa. This reverts commit a1c8571. This reverts commit 94d316f. Only sign tags. It may be that `commitizen` only supports signing tags. See: commitizen-tools/commitizen#616 Remove `tag.gpgsign` and `commit.gpgsign` from local Git config. See if Git will sign for us instead of through `cz`. Remove specifying `gpg.program` and add `commit.gpgsign` back. Add `--gpg-sign` back to `commitizen`. Switch `--gpg-sign` applies to `bump` subcommand. Move `--debug` switch to after `bump` command. This reverts commit e543aff. This reverts commit 3b2cae5. Closes: #50 Closes: #53 Co-authored-by: Hendry, Adam <adam.hendry@metronic.com>
1 parent e62ece2 commit 35d0a04

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

‎action.yml

Lines changed: 12 additions & 1 deletion
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"

‎entrypoint.sh

Lines changed: 9 additions & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /