diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index 0a266b0..cbd7d7c 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -1,14 +1,14 @@ name: Update major tag for release on: release: - types: [released] + types: [published] workflow_dispatch: inputs: TAG_NAME: description: "Tag name that the major tag will point to (e.g. v1.2.3)" required: true env: - TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} + TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.ref}} permissions: contents: write jobs: @@ -16,8 +16,16 @@ jobs: name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes runs-on: ubuntu-latest steps: - - name: Update the ${{ env.TAG_NAME }} tag - uses: actions/publish-action@8a4b4f687b72f481b8a241ef71f38857239698fc - with: - source-tag: ${{ env.TAG_NAME }} - token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout Repo + uses: actions/checkout@v4.2.2 + - name: version + id: version + 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 v${{ steps.version.outputs.major }} + git push origin refs/tags/v${{ steps.version.outputs.major }} -f