Skip to content

Commit 1458b12

Browse files
committed
Add new automated workflow to update stable tag
When we have a "released" event, which is either: - publishing a non-draft release - changing a pre-release to a release `${{ github.ref }}` will be the new release tag when the event is triggered. References: - https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#release - https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=released#release - https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context
1 parent 96fc614 commit 1458b12

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Update Stable Tag
2+
3+
on: [pull_request, push]
4+
# TODO CJR: change event trigger away from test
5+
#release:
6+
# types: [released]
7+
8+
permissions:
9+
contents: write
10+
11+
# TODO CJR: s/test_chad/stable
12+
jobs:
13+
update-stable-tag:
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
# TODO CJR: why does fetch-tags not seem to pull the tag?
20+
fetch-depth: 0
21+
fetch-tags: true
22+
# TODO CJR: do not think we need this with github.ref
23+
- name: Determine build to mark
24+
# returns in reverse chronological order by default
25+
run: echo "STABLE=$(git rev-list --tags --max-count=1)" >> $GITHUB_ENV
26+
- name: Delete current, local stable tag
27+
run: git tag -d test_chad
28+
- name: Create new stable tag
29+
run: git tag test_chad $STABLE # TODO CJR use this for final version ${{ github.ref }}
30+
- name: Force push to overwrite current stable
31+
run: git push -f --tags

0 commit comments

Comments
 (0)