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

Fix lint & create new release #36

Merged
merged 2 commits into from
Sep 1, 2024
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
9 changes: 6 additions & 3 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- macos-latest
- ubuntu-latest
- windows-latest
fail-fast: true
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code # have to checkout to have the source code available
Expand Down Expand Up @@ -126,8 +126,11 @@ jobs:
shell: bash
run: |
[[ "${{ steps.version-prefix.outputs.current-version }}" == "0.0.0" ]]
[[ "${{ steps.version-prefix.outputs.version }}" == "0.0.1" ]]
[[ "${{ steps.version-prefix.outputs.prefixed-version }}" == "foo/[email protected]" ]]
[[ "${{ steps.version-prefix.outputs.major-version }}" == "0" ]]
[[ "${{ steps.version-prefix.outputs.minor-version }}" == "0" ]]
[[ "${{ steps.version-prefix.outputs.patch-version }}" == "1" ]]
[[ "${{ steps.version-prefix.outputs.version }}" = "0.0.1-"* ]]
[[ "${{ steps.version-prefix.outputs.prefixed-version }}" = "foo/[email protected]"* ]]

release:
needs:
Expand Down
7 changes: 4 additions & 3 deletions shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ remove_prefix() {
if [[ -n "${tag_prefix:-}" ]]; then
# Escape special characters in tag_prefix
local escaped_prefix
escaped_prefix=$(printf '%s\n' "$tag_prefix" | sed 's/[][\/.^$*]/\\&/g')
escaped_prefix=$(printf '%s\n' "$tag_prefix" | sed 's/[][\/.^$*]/\\&/g') # special chars matched by sed: ] [ / . ^ $ *

# shellcheck disable=SC2143
if [[ -z "$(echo "${tag}" | grep "^${tag_prefix}")" ]] ; then
echo ""
return
fi
# Use | as the delimiter to avoid conflicts with /
echo "${tag}" | sed "s|^${escaped_prefix}||"
# shellcheck disable=SC2001
echo "${tag}" | sed "s|^${escaped_prefix}||" # Use | as the delimiter to avoid conflicts with /
else
echo "${tag}"
fi
Expand Down
Loading