File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 1
1
name : " Release new version"
2
2
3
3
on :
4
- push :
4
+ pull_request :
5
5
branches :
6
6
- master
7
+ types :
8
+ - closed
7
9
8
10
jobs :
9
11
release :
10
12
runs-on : ubuntu-latest
13
+ if : github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
11
14
steps :
12
- - uses : actions/checkout@v2
13
- - name : Extract version from branch (what about hot fixes?)
14
- run : |
15
- echo "Hello world"
16
- - name : Make new release on GitHub
15
+ - name : Extract version from branch name
17
16
run : |
18
- echo "Hello world"
17
+ BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
18
+ VERSION=${BRANCH_NAME#release/}
19
+
20
+ echo "::set-env name=RELEASE_VERSION::$VERSION"
21
+ - uses : actions/checkout@v2
22
+ - name : Create Release
23
+ uses : actions/create-release@v1
24
+ env :
25
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
26
+ with :
27
+ tag_name : ${{ env.RELEASE_VERSION }}
28
+ release_name : ${{ env.RELEASE_VERSION }}
You can’t perform that action at this time.
0 commit comments