Skip to content

Commit

Permalink
feat: set corresponding prerelease type derived from releaseType
Browse files Browse the repository at this point in the history
BREAKING CHANGE: prerelease option generates pre[major|minor|patch] release
  • Loading branch information
bj00rn committed Nov 28, 2024
1 parent 3c4970b commit 3623e2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ jobs:
uses: ./
env:
ENV: "dont-use-git"
EXPECTED_TAG: "v1.4.6-rc.0"
EXPECTED_TAG: "v1.5.0-rc.0"
with:
github-token: ${{ secrets.github_token }}
version-file: "test-file.json"
Expand All @@ -968,7 +968,7 @@ jobs:
run: node ./test-output.js
env:
FILES: "test-file.json"
EXPECTED_VERSION: "1.4.6-rc.0"
EXPECTED_VERSION: "1.5.0-rc.0"

test-pre-release-identifier:
runs-on: ubuntu-latest
Expand All @@ -990,7 +990,7 @@ jobs:
uses: ./
env:
ENV: "dont-use-git"
EXPECTED_TAG: "v1.4.6-alpha.0"
EXPECTED_TAG: "v1.5.0-alpha.0"
with:
github-token: ${{ secrets.github_token }}
version-file: "test-file.json"
Expand All @@ -1005,7 +1005,7 @@ jobs:
run: node ./test-output.js
env:
FILES: "test-file.json"
EXPECTED_VERSION: "1.4.6-alpha.0"
EXPECTED_VERSION: "1.5.0-alpha.0"

test-pre-release-to-stable:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -1109,4 +1109,4 @@ jobs:
run: |
echo "${{ steps.changelog.outputs.changelog }}" > change_log
sed "s/\(### \)\(.*\)/*\2*/g" change_log > change_log2
diff change_log change_log2 > /dev/null && echo "The changelog has not been generated." || echo "The changelog has been generated."
diff change_log change_log2 > /dev/null && echo "The changelog has not been generated." || echo "The changelog has been generated."
2 changes: 1 addition & 1 deletion src/helpers/bumpVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = async (releaseType, version) => {
const identifier = core.getInput('pre-release-identifier')

if (version) {
newVersion = semver.inc(version, (prerelease ? 'prerelease' : releaseType), identifier)
newVersion = semver.inc(version, (prerelease ? `pre${releaseType}` : releaseType), identifier)
} else {

const fallbackVersion = core.getInput('fallback-version')
Expand Down

0 comments on commit 3623e2d

Please sign in to comment.