From d9667babc122f2c94519928ee5c751d8d9c23512 Mon Sep 17 00:00:00 2001 From: Chad Metcalf Date: Wed, 6 Nov 2024 13:46:57 -0800 Subject: [PATCH] Fix version tag issue and update workflows Fixes #263 Add a step to update the git tag with the major version in the `release.yml` workflow. * Add a new step "Update Major Version Tag" after the "Create Release" step * Extract the major version from the full semver string and create a new git tag with just the major version * Push the new tag to the repository using the `GITHUB_TOKEN` for authentication --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/metcalfc/changelog-generator/issues/263?shareId=XXXX-XXXX-XXXX-XXXX). Signed-off-by: GitHub --- .github/workflows/release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6255a48..9308eb4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,3 +25,10 @@ jobs: name: Release ${{ github.ref }} body: ${{ steps.changelog.outputs.changelog }} token: ${{ secrets.GITHUB_TOKEN }} + - name: Update Major Version Tag + run: | + MAJOR_VERSION=v$(echo "${{ github.ref }}" | grep -oE '^v[0-9]+') + git tag -f $MAJOR_VERSION + git push origin $MAJOR_VERSION --force + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}