Skip to content

Commit

Permalink
Merge pull request #24 from ergofriend/fix-bump-2
Browse files Browse the repository at this point in the history
Fix bump 2
  • Loading branch information
ergofriend committed May 20, 2023
2 parents db59ab9 + f9b05f0 commit ebb19ee
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/auto-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,34 @@ jobs:
git config user.name '${{ secrets.GIT_USER_NAME }}'
git config user.email '${{ secrets.GIT_USER_EMAIL }}'
- name: Current version
run: echo "CURRENT_VERSION=$(jq -r .version < package.json)"" >> $GITHUB_PATH

- name: Bump version
run: |
npm version ${{ inputs.newversion }} --preid ${{ inputs.preid }} --git-tag-version false
- name: Commit
run: "git commit -am 'Bump version to $(jq -r .version < package.json)'"

- name: New version
run: echo "NEW_VERSION=$(jq -r .version < package.json)"" >> $GITHUB_PATH

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
id: cpr
with:
title: bump version to $(jq -r .version < package.json)
body: from ${{ env.CURRENT_VERSION }} to ${{ env.NEW_VERSION }}
assignees: '${{ github.actor }}'

- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Approve a PR
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-url }}"
- name: Enable auto-merge
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-url }}"

- name: Approve request
run: gh pr comment "${{ steps.cpr.outputs.pull-request-url }}" --body "@github-actions approve me"

0 comments on commit ebb19ee

Please sign in to comment.