-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (39 loc) · 1.37 KB
/
version-bump.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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