Skip to content

Commit

Permalink
Remove the "v" during string sanitation to simplify major version ext…
Browse files Browse the repository at this point in the history
…raction
  • Loading branch information
ll-nick committed Nov 21, 2024
1 parent e7934b9 commit 228c042
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- name: Compute new version
id: bump_version
run: |
initial_version=$(source version && echo ${VERSION#v})
new_version=$(.github/workflows/compute_version.sh "$initial_version" "${{ github.event.pull_request.body }}")
source version
new_version=$(.github/workflows/compute_version.sh "$VERSION" "${{ github.event.pull_request.body }}")
echo "new_version=$new_version" >> $GITHUB_OUTPUT
update-version-file:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compute_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ if [[ $# -ne 2 ]]; then
exit 1
fi

initial_version=${1//[^0-9.v]/}
initial_version=${1//[^0-9.]/}
input_string=${2//[^a-zA-Z0-9#]/}

initial_major=$(echo "$initial_version" | cut -d'.' -f1 | cut -d'v' -f2)
initial_major=$(echo "$initial_version" | cut -d'.' -f1)
initial_minor=$(echo "$initial_version" | cut -d'.' -f2)
initial_patch=$(echo "$initial_version" | cut -d'.' -f3)

Expand Down

0 comments on commit 228c042

Please sign in to comment.