File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Update Main Version
2
+ run-name : Move ${{ github.event.inputs.major_version || env.MAJOR_VERSION }} to ${{ github.event.inputs.target || github.sha }}
3
+
4
+ on :
5
+ push :
6
+ tags :
7
+ - ' v[0-9]+.**'
8
+ workflow_dispatch :
9
+ inputs :
10
+ target :
11
+ description : The tag or reference to use
12
+ required : true
13
+ major_version :
14
+ type : choice
15
+ description : The major version to update
16
+ options :
17
+ - v1
18
+
19
+ env :
20
+ MAJOR_VERSION : ' v1'
21
+
22
+ jobs :
23
+ tag :
24
+ runs-on : ubuntu-lates
25
+ permissions :
26
+ contents : write
27
+ steps :
28
+ - uses : actions/checkout@v3
29
+ with :
30
+ fetch-depth : 0
31
+ - name : Git config
32
+ run : |
33
+ git config user.name github-actions
34
+ git config user.email github-actions@github.com
35
+ # - name: Get major version from tag name
36
+ # if: ${{ github.event_name === 'push' }}
37
+ # run: echo "MAJOR_VERSION=`echo ${GITHUB_REF#refs/*/} | cut -c1-2`" >> $GITHUB_ENV
38
+ - name : Tag new target
39
+ run : git tag -f ${{ github.event.inputs.major_version || env.MAJOR_VERSION }} ${{ github.event.inputs.target || github.sha }}
40
+ - name : Push new tag
41
+ run : git push origin ${{ github.event.inputs.major_version || env.MAJOR_VERSION }} --force
You can’t perform that action at this time.
0 commit comments