Skip to content

Commit

Permalink
feat: add support for strip a prefix from the tag (#249)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
jackton1 and github-actions[bot] authored Jul 20, 2023
1 parent 23f4849 commit 26b0ca2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ runs:
INPUT_PATHS: ${{ inputs.paths }}
INPUT_PATTERN: ${{ inputs.pattern }}
INPUT_ONLY_MAJOR: ${{ inputs.only_major }}
INPUT_STRIP_PREFIX: ${{ inputs.strip_prefix }}
branding:
icon: arrow-up
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ if [[ -z "$CURRENT_TAG" ]]; then
CURRENT_TAG=$(git tag --sort=-v:refname | grep -vE "^v[0-9]+$" | head -n 2 | tail -n 1) && exit_status=$? || exit_status=$?
fi

if [[ -n "$INPUT_STRIP_PREFIX" ]]; then
CURRENT_TAG=${CURRENT_TAG#"$INPUT_STRIP_PREFIX"}
NEW_TAG=${NEW_TAG#"$INPUT_STRIP_PREFIX"}
fi

if [[ $exit_status -ne 0 ]]; then
echo "::warning::Initial release detected no updates would be made to specified files."
echo "::warning::Setting new_version and old_version to $NEW_TAG."
Expand Down

0 comments on commit 26b0ca2

Please sign in to comment.