-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.24 KB
/
update-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
name: Update package version
on:
pull_request:
types: [closed]
branches:
- master
jobs:
update_version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get the source branch name
id: get_source_branch_name
run: echo ::set-output name=branch::${{ github.event.pull_request.head.ref }}
- name: Update package version
run: |
BRANCH_NAME="${{ steps.get_source_branch_name.outputs.branch }}"
if [[ $BRANCH_NAME == break/* ]]; then
npm version major --no-git-tag-version
elif [[ $BRANCH_NAME == feat/* ]]; then
npm version minor --no-git-tag-version
else
npm version patch --no-git-tag-version
fi
- name: Commit version update
run: |
git config --global user.email "[email protected]"
git config --global user.name "amine-abdelli"
git commit -am "chore(release): update package version [skip ci]"
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.event.pull_request.base.ref }}
force: true