Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions .github/workflows/major-version-updater.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: "Major Version Updater"
on:
workflow_call:
inputs:
tag_name:
required: true
type: string
permissions:
contents: read
jobs:
major_version_updater:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/[email protected]
with:
fetch-tags: true
ref: ${{ inputs.tag_name }}
- name: version
id: version
env:
TAG_NAME: ${{ inputs.tag_name }}
run: |
tag=${TAG_NAME/refs\/tags\//}
version=${tag#v}
major=${version%%.*}
{ echo "tag=${tag}"; echo "version=${version}"; echo "major=${major}"; } >> "$GITHUB_OUTPUT"
- name: force update major tag
run: |
git tag -f v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }}
git push -f origin v${{ steps.version.outputs.major }}
19 changes: 19 additions & 0 deletions .github/workflows/test-major-version-updater.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: "Test Major Version Updater"
on:
release:
types: [published]
workflow_dispatch:
inputs:
TAG_NAME:
description: "Tag name that the major tag will point to (e.g. v1.2.3)"
required: true
permissions:
contents: read
jobs:
labeler:
permissions:
contents: write
uses: ./.github/workflows/major-version-updater.yaml
with:
tag_name: ${{ github.event.inputs.TAG_NAME || github.ref}}
Loading