Skip to content

Commit

Permalink
Fix the output when skipping creating PR (#6919)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
  • Loading branch information
Nokel81 authored Jan 11, 2023
1 parent 675e3a8 commit c91a4cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/bump-master-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,23 @@ jobs:
run: |
npm i --location=global semver
- name: Bump version to first alpha of next minor version
id: bump
run: |
CURRENT_VERSION=$(cat package.json | jq .version --raw-output)
if ! [[ "${CURRENT_VERSION}" =~ ^\d+\.\d+\.0$ ]]; then
echo "Not a minor release"
exit 1
echo "status=skip" >> $GITHUB_OUTPUT
exit 0
fi
NEW_VERSION=$(cat package.json | jq .version --raw-output | xargs semver -i preminor --preid alpha)
cat package.json | jq --arg new_version "$NEW_VERSION" '.version = $new_version' > new-package.json
mv new-package.json package.json
echo "status=create" >> $GITHUB_OUTPUT
- uses: peter-evans/create-pull-request@v4
if: ${{ success() }}
if: ${{ steps.bump.outputs.status == "create" }}
with:
add-paths: package.json
commit-message: Update package.json version to next preminor because of recent release
Expand Down

0 comments on commit c91a4cb

Please sign in to comment.