Skip to content

Commit

Permalink
fix(gha): add missing tag option to GitHub Action definition (#908)
Browse files Browse the repository at this point in the history
  Resolves: #906
  • Loading branch information
codejedi365 committed May 5, 2024
1 parent f641a12 commit 6b24288
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
7 changes: 5 additions & 2 deletions action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

# Convert "true"/"false" into command line args
# Convert "true"/"false" into command line args, returns "" if not defined
eval_boolean_action_input() {
local -r input_name="$1"
shift
Expand All @@ -12,7 +12,9 @@ eval_boolean_action_input() {
shift
local -r if_false="$1"

if [ "$flag_value" = "true" ]; then
if [ -z "$flag_value" ]; then
echo ""
elif [ "$flag_value" = "true" ]; then
echo "$if_true"
elif [ "$flag_value" = "false" ]; then
echo "$if_false"
Expand Down Expand Up @@ -42,6 +44,7 @@ export VCS_RELEASE="${INPUT_VCS_RELEASE:="false"}"
export ARGS=()
ARGS+=("$(eval_boolean_action_input "prerelease" "$PRERELEASE" "--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
ARGS+=("$(eval_boolean_action_input "changelog" "$CHANGELOG" "--changelog" "--no-changelog")") || exit 1
ARGS+=("$(eval_boolean_action_input "vcs_release" "$VCS_RELEASE" "--vcs-release" "--no-vcs-release")") || exit 1
Expand Down
13 changes: 10 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,22 @@ inputs:
default: "true"
description: Whether or not to commit changes locally

tag:
type: string
required: false
description: |
Whether or not to make a local version tag. Defaults are handled
by python-semantic-release internal version command.
push:
type: string
required: false
default: "true"
description: |
Whether or not to push local commits to the Git repository.
Defaults to "true", but when the "commit" input is "false"
this will also be set to "false" regardless of the value
supplied.
Defaults to "true", but when either the "commit" or "tag"
input is "false", this push setting will also be set to
"false" regardless of the value supplied.
changelog:
type: string
Expand Down

0 comments on commit 6b24288

Please sign in to comment.