Skip to content

Commit c7b850c

Browse files
committed
chore: echo next_version and handle release_type as choice
copilot says ✅ Confidence Level: HIGH - This Should Work
1 parent 3ed9923 commit c7b850c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,28 @@ jobs:
5454
id: manual_release
5555
run: |
5656
npm install -g release-please
57+
npm install semver
5758
5859
# Get current version from manifest
5960
CURRENT_VERSION=$(cat .release-please-manifest.json | jq -r '.Website')
6061
echo "Current version: $CURRENT_VERSION"
6162
62-
# Create release PR with specific version bump
63+
# Calculate next version based on release type using Node.js
64+
NEXT_VERSION=$(node -e "
65+
const semver = require('semver');
66+
const current = '$CURRENT_VERSION';
67+
const type = '${{ github.event.inputs.release_type }}';
68+
console.log(semver.inc(current, type));
69+
")
70+
71+
echo "Next version will be: $NEXT_VERSION"
72+
73+
# Create release PR with specific version
6374
release-please release-pr \
6475
--repo-url="https://github.com/${{ github.repository }}" \
6576
--config-file=release-please-config.json \
6677
--manifest-file=.release-please-manifest.json \
67-
--release-as=${{ github.event.inputs.release_type }} \
78+
--release-as=$NEXT_VERSION \
6879
--token=${{ secrets.GITHUB_TOKEN }}
6980
7081
echo "releases_created=true" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)