Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/move_major_ver_tag_on_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Move Major Version Tag on Release

on:
release:
types: [ published ]
workflow_dispatch:
inputs:
release_tag:
required: true
type: string

jobs:
move_major_version_tag:
runs-on: ubuntu-latest
steps:

# Checks out the code from your repository with all history for all
# branches and tags. This is important if the workflow is launched via
# workspace_dispatch event. It ensures that we can find the release tag
# and the major version tag.
- uses: actions/checkout@v4
with:
# Fetch all history for all branches and tags
fetch-depth: 0

# Configures the git user config. This is necessary when making changes
# to a git repository.
- uses: cgrindel/gha_configure_git_user@v1

# The release tag can come into the workflow via the release event or as
# a workflow_dispatch event. This step finds the first non-empty value
# and outputs it as `selected_value`.
- name: Resolve release_tag
id: resolve_release_tag
uses: cgrindel/gha_select_value@v1
with:
value0: ${{ github.event.release.tag_name }}
value1: ${{ github.event.inputs.release_tag }}

# Create or move the major version tag
- uses: cgrindel/gha_move_major_version_tag@v1
with:
release_tag: ${{ steps.resolve_release_tag.outputs.selected_value }}