Skip to content

Commit a1bdfab

Browse files
authored
chore: add workflow to move the major version tag (#2)
Related to https://github.com/tweag/scalable-builds-group/issues/138.
1 parent 5dd9179 commit a1bdfab

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Move Major Version Tag on Release
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
workflow_dispatch:
7+
inputs:
8+
release_tag:
9+
required: true
10+
type: string
11+
12+
jobs:
13+
move_major_version_tag:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
# Checks out the code from your repository with all history for all
18+
# branches and tags. This is important if the workflow is launched via
19+
# workspace_dispatch event. It ensures that we can find the release tag
20+
# and the major version tag.
21+
- uses: actions/checkout@v4
22+
with:
23+
# Fetch all history for all branches and tags
24+
fetch-depth: 0
25+
26+
# Configures the git user config. This is necessary when making changes
27+
# to a git repository.
28+
- uses: cgrindel/gha_configure_git_user@v1
29+
30+
# The release tag can come into the workflow via the release event or as
31+
# a workflow_dispatch event. This step finds the first non-empty value
32+
# and outputs it as `selected_value`.
33+
- name: Resolve release_tag
34+
id: resolve_release_tag
35+
uses: cgrindel/gha_select_value@v1
36+
with:
37+
value0: ${{ github.event.release.tag_name }}
38+
value1: ${{ github.event.inputs.release_tag }}
39+
40+
# Create or move the major version tag
41+
- uses: cgrindel/gha_move_major_version_tag@v1
42+
with:
43+
release_tag: ${{ steps.resolve_release_tag.outputs.selected_value }}

0 commit comments

Comments
 (0)