Skip to content

Commit

Permalink
ci: Add workflow to update major release tag (#31)
Browse files Browse the repository at this point in the history
* Add workflow to update major release tag, ensuring that Github action
users can point to a major version like `actions-novu-sync@v2` and
always get latest patch and minor version updates. Each release created
via Github will trigger the action automatically.
  • Loading branch information
rifont authored Jul 2, 2024
1 parent dceec32 commit 07e3e62
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/major-release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# see https://gist.github.com/cicirello/ade1d559a89104140557389365154bc1
# This action updates forcefully updates and pushes the major release Git tag
# to the latest release version.
#
# This ensures Github action users can use the major release tag to trigger
# workflows for a given major release, whilst receiving updates from minor and
# patch releases.
#
# Example: v2.0.4 -> v2
# Example: v2.1.0 -> v2

name: Update Major Release Tag

on:
release:
types: [created]

jobs:
movetag:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Get major version num and update tag
run: |
VERSION=${GITHUB_REF#refs/tags/}
MAJOR=${VERSION%%.*}
git config --global user.name 'novu-bot'
git config --global user.email '[email protected]'
git tag -fa "${MAJOR}" -m 'Update major version tag'
git push origin "${MAJOR}" --force

0 comments on commit 07e3e62

Please sign in to comment.