File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ # Create tags with only major or major.minor version
2+ # This runs for every created release. Releases are expected to use vmajor.minor.patch as tags.
3+
4+ name : Autotag Release
5+ on :
6+ release :
7+ types : [released]
8+ workflow_dispatch :
9+ permissions : read-all
10+
11+ jobs :
12+ autotag_release :
13+ runs-on : ubuntu-latest
14+ if : startsWith(github.ref, 'refs/tags/v')
15+ permissions :
16+ contents : write
17+ steps :
18+ - uses : actions/checkout@v3
19+ - name : Get version from tag
20+ id : tag_name
21+ run : |
22+ echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
23+ shell : bash
24+ - name : Create and push tags
25+ run : |
26+ MINOR="$(echo -n ${{ steps.tag_name.outputs.current_version }} | cut -d. -f1-2)"
27+ MAJOR="$(echo -n ${{ steps.tag_name.outputs.current_version }} | cut -d. -f1)"
28+ git tag -f "${MINOR}"
29+ git tag -f "${MAJOR}"
30+ git push -f origin "${MINOR}"
31+ git push -f origin "${MAJOR}"
You can’t perform that action at this time.
0 commit comments