Skip to content

Commit

Permalink
Fix additional string quoting (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd authored Dec 20, 2022
1 parent a7b2343 commit c9a9216
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
env:
PREFIX: 'ci-v'
TEST_TAG: 'ci-v1.2.3'
TEST_TAG_PREREL: 'ci-v2.3.4-prerelease'
TAG_MAJOR: 'ci-v1'
Expand All @@ -46,21 +47,21 @@ jobs:
- name: 'TEST: Update Major'
uses: ./.
with:
tag: ${{ env.TEST_TAG }}
prefix: 'ci-v'
tag: "refs/tags/${{ env.TEST_TAG }}"
prefix: ${{ env.PREFIX }}

- name: 'TEST: Update Minor'
uses: ./.
with:
tag: ${{ env.TEST_TAG }}
prefix: 'ci-v'
tag: "refs/tags/${{ env.TEST_TAG }}"
prefix: ${{ env.PREFIX }}
update-minor: true

- name: 'TEST: Ignore Prerelease'
uses: ./.
with:
tag: ${{ env.TEST_TAG_PREREL }}
prefix: 'ci-v'
tag: "refs/tags/${{ env.TEST_TAG_PREREL }}"
prefix: ${{ env.PREFIX }}

- name: Cleanup
if: always()
Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,24 @@ runs:
INPUT_TAG: ${{ inputs.tag }}
INPUT_PREFIX: ${{ inputs.prefix }}
run: |
version=$INPUT_TAG
version="$INPUT_TAG"
if [[ -z "$version" ]]; then
version=$GITHUB_REF
version="$GITHUB_REF"
fi
echo "Target tag name or reference: '$version'"
version="${version#refs/}"
version="${version#tags/}"
version="${version#$INPUT_PREFIX}"
echo "Target version: '$version'"
semvertool="$GITHUB_ACTION_PATH/semver-tool/semver.sh"
status=$("$semvertool" validate "$version")
if [[ "$status" != "valid" ]]; then
echo ::error ::Version $version does not match the semver scheme 'X.Y.Z(-PRERELEASE)(+BUILD)'
echo "::error ::Version '$version' does not match the semver scheme 'X.Y.Z(-PRERELEASE)(+BUILD)'"
exit 1
fi
Expand Down

0 comments on commit c9a9216

Please sign in to comment.