Skip to content

Commit

Permalink
fix version extraction for check_release_version
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Feb 6, 2025
1 parent 05fa66e commit 361517b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/check-pr-to-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,20 @@ jobs:
.github/parse-version/action.yml
sparse-checkout-cone-mode: false

- name: Parse version
- run: npm install --no-save semver
shell: bash

# parse-version action doesn't exactly do what we want
- name: Extract short version
id: version
uses: ./.github/parse-version
run: |
result=$(node -e "const {version} = require('./package.json'); const semver = require('semver'); const parsed = semver.parse(version); console.log(parsed.minor + '.' + parsed.patch);")
echo "release_version_short=$result" >> GITHUB_OUTPUT
- name: Assert release version is not pre-release
if: endsWith(steps.version.outputs.releaseVersion, '-pre')
if: endsWith(steps.version.outputs.release_version_short, '-pre')
run: exit 1

- name: Assert release version matches RC branch name
if: format('rc/v{0}', steps.version.outputs.releaseShort) != github.head_ref
if: format('rc/v{0}', steps.version.outputs.release_version_short) != github.head_ref
run: exit 1

0 comments on commit 361517b

Please sign in to comment.