File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 1
1
name : Update major tag for release
2
2
on :
3
3
release :
4
- types : [released ]
4
+ types : [published ]
5
5
workflow_dispatch :
6
6
inputs :
7
7
TAG_NAME :
8
8
description : " Tag name that the major tag will point to (e.g. v1.2.3)"
9
9
required : true
10
10
env :
11
- TAG_NAME : ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
11
+ TAG_NAME : ${{ github.event.inputs.TAG_NAME || github.ref }}
12
12
permissions :
13
13
contents : write
14
14
jobs :
15
15
update_tag :
16
16
name : Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
17
17
runs-on : ubuntu-latest
18
18
steps :
19
- - name : Update the ${{ env.TAG_NAME }} tag
20
- uses : actions/publish-action@8a4b4f687b72f481b8a241ef71f38857239698fc
21
- with :
22
- source-tag : ${{ env.TAG_NAME }}
23
- token : ${{ secrets.GITHUB_TOKEN }}
19
+ - name : Checkout Repo
20
+
21
+ - name : version
22
+ id : version
23
+ run : |
24
+ tag=${TAG_NAME/refs\/tags\//}
25
+ version=${tag#v}
26
+ major=${version%%.*}
27
+ { echo "tag=${tag}"; echo "version=${version}"; echo "major=${major}"; } >> "$GITHUB_OUTPUT"
28
+ - name : force update major tag
29
+ run : |
30
+ git tag v${{ steps.version.outputs.major }}
31
+ git push origin refs/tags/v${{ steps.version.outputs.major }} -f
You can’t perform that action at this time.
0 commit comments