-
Notifications
You must be signed in to change notification settings - Fork 580
55 lines (46 loc) · 1.39 KB
/
pr-bump-version.yml
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
50
51
52
53
54
55
name: PR Bump Version
on:
pull_request_target:
branches: [dev]
jobs:
bump_version_check:
name: Bump version check
if: github.repository == 'be5invis/Iosevka' && github.base_ref == 'dev'
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.check_changes.outputs.changed }}
steps:
- name: Checkout PR
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Bump version
run: |
npm install
npm run bump-ver
- id: check_changes
name: Check changes
run: |
git config core.autocrlf false
if git diff --quiet; then
echo "changed=0" >> "$GITHUB_OUTPUT"
else
echo "changed=1" >> "$GITHUB_OUTPUT"
fi
- name: Commit to PR
if: steps.check_changes.outputs.changed == '1'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add --all
git commit -m "Bump version"
git push
- name: Add PR comment
uses: mshick/add-pr-comment@v2
if : steps.check_changes.outputs.changed == '1'
with:
message: |
Your pull request changes the version number.
A commit has been made to bump the version number.