Skip to content

Commit 339d628

Browse files
Create release-tag.yaml (#573)
* Create release-tag.yaml * Update release-tag.yaml to our own workflow
1 parent b2561c5 commit 339d628

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/release-tag.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Tag Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
concurrency:
8+
group: release-tag
9+
cancel-in-progress: false
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
update-tag:
16+
runs-on: ubuntu-latest
17+
if: ${{ !github.event.release.prerelease && !github.event.release.draft }}
18+
19+
steps:
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

0 commit comments

Comments
 (0)