From e9d8eed71cdbca86461e1b719396d9bfd4a58ce6 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Wed, 1 May 2024 20:02:32 -0400 Subject: [PATCH 01/12] fix(gha): correct use of `prerelease` option for GitHub Action --- action.sh | 6 ++++-- action.yml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/action.sh b/action.sh index 3ec7c6624..13885c0c6 100755 --- a/action.sh +++ b/action.sh @@ -34,6 +34,7 @@ export SSH_PRIVATE_SIGNING_KEY="${INPUT_SSH_PRIVATE_SIGNING_KEY}" export SSH_PUBLIC_SIGNING_KEY="${INPUT_SSH_PUBLIC_SIGNING_KEY}" export GIT_COMMIT_AUTHOR="${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}>" export ROOT_OPTIONS="${INPUT_ROOT_OPTIONS:="-v"}" +# v10 BREAKING CHANGE, to correct this input value to match cli? export PRERELEASE="${INPUT_PRERELEASE:="false"}" export COMMIT="${INPUT_COMMIT:="false"}" export PUSH="${INPUT_PUSH:="false"}" @@ -42,7 +43,8 @@ export VCS_RELEASE="${INPUT_VCS_RELEASE:="false"}" # Convert inputs to command line arguments export ARGS=() -ARGS+=("$(eval_boolean_action_input "prerelease" "$PRERELEASE" "--prerelease" "")") || exit 1 +# v10 Breaking change? +ARGS+=("$(eval_boolean_action_input "prerelease" "$PRERELEASE" "--as-prerelease" "")") || exit 1 ARGS+=("$(eval_boolean_action_input "commit" "$COMMIT" "--commit" "--no-commit")") || exit 1 ARGS+=("$(eval_boolean_action_input "tag" "$INPUT_TAG" "--tag" "--no-tag")") || exit 1 ARGS+=("$(eval_boolean_action_input "push" "$PUSH" "--push" "--no-push")") || exit 1 @@ -51,7 +53,7 @@ ARGS+=("$(eval_boolean_action_input "vcs_release" "$VCS_RELEASE" "--vcs-release" # Handle --patch, --minor, --major # https://stackoverflow.com/a/47541882 -valid_force_levels=("patch" "minor" "major") +valid_force_levels=("prerelease" "patch" "minor" "major") if [ -z "$INPUT_FORCE" ]; then true # do nothing if 'force' input is not set elif printf '%s\0' "${valid_force_levels[@]}" | grep -Fxzq "$INPUT_FORCE"; then diff --git a/action.yml b/action.yml index 481f14ae1..480e9fe40 100644 --- a/action.yml +++ b/action.yml @@ -48,7 +48,7 @@ inputs: required: false description: | Force the next version to be a major release. Must be set to - one of "patch", "minor", or "major". + one of "prerelease", "patch", "minor", or "major". commit: type: string From 65be60b9169682dda3207ca366f3eaac5c03c4f5 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Wed, 1 May 2024 20:03:20 -0400 Subject: [PATCH 02/12] style(gha): improve shell format of GitHub Action script --- action.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.sh b/action.sh index 13885c0c6..e296e63e6 100755 --- a/action.sh +++ b/action.sh @@ -77,7 +77,7 @@ git config --global user.email "$GIT_COMMITTER_EMAIL" # and https://github.com/actions/runner-images/issues/6775#issuecomment-1410270956 git config --system --add safe.directory "*" -if [[ -n $SSH_PUBLIC_SIGNING_KEY && -n $SSH_PRIVATE_SIGNING_KEY ]]; then +if [[ -n "$SSH_PUBLIC_SIGNING_KEY" && -n "$SSH_PRIVATE_SIGNING_KEY" ]]; then echo "SSH Key pair found, configuring signing..." mkdir ~/.ssh echo -e "$SSH_PRIVATE_SIGNING_KEY" >>~/.ssh/signing_key @@ -90,8 +90,8 @@ if [[ -n $SSH_PUBLIC_SIGNING_KEY && -n $SSH_PRIVATE_SIGNING_KEY ]]; then git config --global gpg.format ssh git config --global user.signingKey ~/.ssh/signing_key git config --global commit.gpgsign true - git config --global user.email $GIT_COMMITTER_EMAIL - git config --global user.name $GIT_COMMITTER_NAME + git config --global user.email "$GIT_COMMITTER_EMAIL" + git config --global user.name "$GIT_COMMITTER_NAME" touch ~/.ssh/allowed_signers echo "$GIT_COMMITTER_EMAIL $SSH_PUBLIC_SIGNING_KEY" >~/.ssh/allowed_signers git config --global gpg.ssh.allowedSignersFile ~/.ssh/allowed_signers From a10b7c8098f926fbc3ec9569c2ac22e85c493d66 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Wed, 1 May 2024 20:07:37 -0400 Subject: [PATCH 03/12] docs(gha): update GitHub Actions doc with all available options --- docs/github-action.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/github-action.rst b/docs/github-action.rst index 7129ede28..ae3a4e23e 100644 --- a/docs/github-action.rst +++ b/docs/github-action.rst @@ -106,8 +106,8 @@ defaults as their corresponding command line option. In general, the input for an action corresponding to a command line option has the same name, with dashes (``-``) replaced by underscores. -The command line arguments ``--patch``, ``--minor`` and ``--major`` are mutually -exclusive, and are supplied via the ``force`` input. +The command line arguments ``--prerelease``, ``--patch``, ``--minor`` and ``--major`` +are mutually exclusive, and are supplied via the ``force`` input. Flags, which require either ``--