Skip to content

Commit

Permalink
feat: set corresponding prerelease type from releaseType (#273)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: prerelease option generates pre[major|minor|patch]
release tag
  • Loading branch information
TriPSs authored Nov 28, 2024
2 parents 3c4970b + 792a7f7 commit c6e8c21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 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
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 c6e8c21

Please sign in to comment.