File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 1
1
on :
2
2
push :
3
- tags :
4
- - ' v* ' # Push events to matching v*, i.e. v1.0, v20.15.10
5
-
6
- name : Create Release
3
+ branches :
4
+ - main
5
+ paths :
6
+ - " package.json "
7
7
8
+ name : Create Release if version is bumped
8
9
jobs :
9
10
build :
10
11
name : Create Release
11
12
runs-on : ubuntu-latest
12
13
steps :
13
14
- name : Checkout code
14
15
uses : actions/checkout@v2
16
+ - run : git fetch --prune --unshallow --tags
17
+ - uses : kanga333/config-value-exporter@main
18
+ id : version
19
+ with :
20
+ key : version
21
+ file : package.json
22
+ - id : tag_check
23
+ run : |
24
+ git rev-parse ${{steps.version.outputs.result}} 2> /dev/null \
25
+ || echo '::set-output name=exist::false'
15
26
- name : Create Release
27
+ if : steps.tag_check.outputs.exist == 'false'
16
28
id : create_release
17
29
uses : actions/create-release@v1
18
30
env :
19
31
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20
32
with :
21
- tag_name : ${{ github.ref }}
22
- release_name : Release ${{ github.ref }}
33
+ tag_name : ${{steps.version.outputs.result }}
34
+ release_name : Release ${{steps.version.outputs.result }}
23
35
draft : false
24
36
prerelease : false
You can’t perform that action at this time.
0 commit comments