Skip to content

Feature/test version bump #2

Feature/test version bump

Feature/test version bump #2

Workflow file for this run

name: Version Bump
on:
pull_request:
types:
- closed
branches:
- 'main'
jobs:
check_and_bump_version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup nodejs
uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: npm ci
- run: |
echo The PR was merged
if git diff --name-only ${{ toJson(github.event.pull_request.base.sha) }} ${{ toJson(github.event.pull_request.head.sha) }} | grep fate-product-list.csv
then
# Note: the following account information will not work on GHES
# Taken from the checkout github action, used above, at https://github.com/actions/checkout
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if npm version major -m "Version updated to %s because product list changed."
then
echo "Version updated to " $( jq .version package.json ) "."
git push --follow-tags
else
echo "Couldn't update version for some reason."
fi
else
echo "No changes to product list."
fi