Skip to content

Commit

Permalink
fix(ci): Fix tag validation
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Oct 1, 2024
1 parent de197ed commit f655656
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# - name: Load version from git tag
# id: version
# uses: nowsprinting/check-version-format-action@v4

- uses: actions-ecosystem/action-get-latest-tag@v1
id: version
with:
semver_only: true
with_initial_version: false

- name: Validate version from git tag
if: steps.version.outputs.tag == ''
run: echo "Tag must follow SemVer convention. Aborting." && exit 1

# - name: Validate version from git tag
# if: steps.version.outputs.is_valid != 'true'
Expand All @@ -46,16 +35,16 @@ jobs:
script: |
const gitTag = '${{ steps.version.outputs.tag }}'
console.log(`git tag: ${gitTag}`)
const distTag = gitTag.match(/^v\d+\.\d+\.\d+$/) ? 'latest' : 'alpha'
if (gitTag.match(/^v\d+\.\d+\.\d+$/)) {
distTag = 'latest'
} else if (gitTag.match(/^v\d+\.\d+\.\d+/)) {
distTag = 'alpha'
} else {
core.setFailed('Tag must follow SemVer convention. Aborting.');
}
console.log(`npm dist tag: ${distTag}`)
return distTag
# TODO: Enable after reaching 1.0.0.
# This may indicate that the tag set has a typo ("alpah", etc.)
# - name: Validate parsed version
# if: steps.version.outputs.is_stable == 'false' && steps.get-release-type.outputs.result == 'latest'
# run: echo "Tag set may be incorrect. Please, review." && exit 1

- name: Install
run: |
corepack enable
Expand Down

0 comments on commit f655656

Please sign in to comment.