Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ jobs:
# If pull request was merged then we should check for a package version update
check-version-update:
runs-on: ubuntu-22.04
outputs:
should-bump: ${{ steps.version-check.outputs.should-bump }}
steps:
# Checkout to target branch
- uses: actions/checkout@v2
- uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -26,20 +28,29 @@ jobs:
id: packageOld
uses: codex-team/action-nodejs-package-info@v1

# Stop workflow and do not bump version if it was changed already
- name: Stop workflow and do not bump version if it was changed already
uses: andymckay/cancel-action@0.2
if: steps.packageOld.outputs.version != steps.packageNew.outputs.version
# Check if version should be bumped
- name: Check if version should be bumped
id: version-check
run: |
if [ "${{ steps.packageOld.outputs.version }}" == "${{ steps.packageNew.outputs.version }}" ]; then
echo "should-bump=true" >> $GITHUB_OUTPUT
else
echo "should-bump=false" >> $GITHUB_OUTPUT
fi

bump-version:
needs: check-version-update
if: needs.check-version-update.outputs.should-bump == 'true'
runs-on: ubuntu-22.04
steps:
# Checkout to target branch
- uses: actions/checkout@v2
- uses: actions/checkout@v5
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

# Setup node environment
- uses: actions/setup-node@v3
- uses: actions/setup-node@v5
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
Expand All @@ -54,7 +65,7 @@ jobs:
uses: codex-team/action-nodejs-package-info@v1

# Commit version upgrade
- uses: EndBug/add-and-commit@v7
- uses: EndBug/add-and-commit@v9
with:
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawk.api",
"version": "1.1.35",
"version": "1.1.36",
"main": "index.ts",
"license": "UNLICENSED",
"scripts": {
Expand Down
Loading