File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,14 +2,36 @@ name: Tag Release
22
33on :
44 release :
5+ types : [published]
6+
7+ concurrency :
8+ group : release-tag
9+ cancel-in-progress : false
10+
11+ permissions :
12+ contents : write
513
614jobs :
715 update-tag :
816 runs-on : ubuntu-latest
9-
17+ if : ${{ !github.event.release.prerelease && !github.event.release.draft }}
18+
1019 steps :
11- - name : Run latest-tag
12- uses : EndBug/latest-tag@latest
13- with :
14- ref : prod
15- description : Latest release to prod
20+ - name : Checkout the release commit
21+ uses : actions/checkout@v4
22+ with :
23+ ref : ${{ github.event.release.tag_name }}
24+ fetch-depth : 1
25+
26+ - name : Configure git identity
27+ run : |
28+ git config user.name "latest github tag bot"
29+ git config user.email "webmaster@csh.rit.edu"
30+
31+ - name : Move "latest" to the release commit
32+ run : |
33+ set -euo pipefail
34+ target_sha="$(git rev-parse "HEAD^{commit}")" # parses tag to git sha hash
35+ echo "Release ${{ github.event.release.tag_name }} -> ${target_sha}"
36+ git tag --force latest "${target_sha}"
37+ git push --force origin refs/tags/latest
You can’t perform that action at this time.
0 commit comments