Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for strip a prefix from the tag #249

Merged
merged 3 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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