File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 5
5
inputs :
6
6
version :
7
7
description : New version number (e.g. '1.2.3' without the 'v' prefix)
8
- required : true
9
8
10
9
jobs :
11
10
prepare_release :
@@ -18,10 +17,24 @@ jobs:
18
17
with :
19
18
app_id : ${{ secrets.PIPELINE_GITHUB_APP_ID }}
20
19
private_key : ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
20
+
21
+ - name : Calculate version
22
+ id : get_version
23
+ run : |
24
+ if [ "${VERSION}" = "" ] ; then
25
+ LATEST_TAG=$(git describe --tags --abbrev=0)
26
+ NEXT_TAG=$(echo ${LATEST_TAG} | awk '{split($0, a, "."); print a[1] "." a[2] + 1 "." a[3]}')
27
+ echo ::set-output name=version::$NEXT_TAG
28
+ else
29
+ echo ::set-output name=version::$VERSION
30
+ fi
31
+ env :
32
+ VERSION : ${{ github.event.inputs.version }}
33
+
21
34
- name : Create PR
22
35
uses : actions/github-script@v5
23
36
env :
24
- RELEASE_VERSION : ${{ github.event.inputs .version }}
37
+ RELEASE_VERSION : ${{ steps.get_version.outputs .version }}
25
38
with :
26
39
github-token : ${{ steps.get_token.outputs.token }}
27
40
script : |
You can’t perform that action at this time.
0 commit comments