From 8ec8f198dc92044e8bed58678de7a8878bd9bd1d Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Thu, 8 May 2025 10:24:03 -0500 Subject: [PATCH 1/2] Update branch tags only when releases are made Also use https://github.com/tj-actions/release-tagger instead of our own custom workflow code. --- .github/workflows/update-main-version.yml | 47 ++++++----------------- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/.github/workflows/update-main-version.yml b/.github/workflows/update-main-version.yml index 467f31f..7f276a7 100644 --- a/.github/workflows/update-main-version.yml +++ b/.github/workflows/update-main-version.yml @@ -1,41 +1,18 @@ -name: Update Main Version -run-name: Move ${{ github.event.inputs.major_version || 'latest branch tag' }} to ${{ github.event.inputs.target || github.sha }} +name: Update release version -on: - push: - tags: - - 'v[0-9]+.**' - workflow_dispatch: - inputs: - target: - description: The tag or reference to use - required: true - major_version: - type: choice - description: The major version to update - options: - - v1 +permissions: + contents: write -env: - MAJOR_VERSION: 'v1' +on: + release: + types: [published] jobs: - tag: + update-version: runs-on: ubuntu-latest - permissions: - contents: write steps: - - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Git config - run: | - git config user.name github-actions - git config user.email github-actions@github.com - #- name: Get major version from tag name - # if: ${{ github.event_name === 'push' }} - # run: echo "MAJOR_VERSION=`echo ${GITHUB_REF#refs/*/} | cut -c1-2`" >> $GITHUB_ENV - - name: Tag new target - run: git tag -f ${{ github.event.inputs.major_version || env.MAJOR_VERSION }} ${{ github.event.inputs.target || github.sha }} - - name: Push new tag - run: git push origin ${{ github.event.inputs.major_version || env.MAJOR_VERSION }} --force + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Run release-tagger + uses: tj-actions/release-tagger@v4 From 0ac5c782d5da06e1f81bfe67ad38cdb65b8e661e Mon Sep 17 00:00:00 2001 From: Jonas Eberle Date: Tue, 23 Sep 2025 08:28:40 +0200 Subject: [PATCH 2/2] Update .github/workflows/update-main-version.yml Co-authored-by: Stanislav Zhuk --- .github/workflows/update-main-version.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-main-version.yml b/.github/workflows/update-main-version.yml index 7f276a7..77e66ef 100644 --- a/.github/workflows/update-main-version.yml +++ b/.github/workflows/update-main-version.yml @@ -4,8 +4,9 @@ permissions: contents: write on: - release: - types: [published] + push: + tags: + - v* jobs: update-version: