From 26fe7d6b0e98ba2cb47335347aa5d23311ac5733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Dvo=C5=99=C3=A1k?= <484607+mdvorak@users.noreply.github.com> Date: Tue, 5 Jul 2022 16:29:32 +0200 Subject: [PATCH] SQSCANGHA-4 Publish MAJOR and MAJOR.MINOR tags in addition to MAJOR.MINOR.PATCH (#35) --- .github/workflows/update-tags.yml | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/update-tags.yml diff --git a/.github/workflows/update-tags.yml b/.github/workflows/update-tags.yml new file mode 100644 index 0000000..39f1b55 --- /dev/null +++ b/.github/workflows/update-tags.yml @@ -0,0 +1,32 @@ +name: Update Tags + +on: + push: + tags: + - v*.*.* + +jobs: + generate: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Parse semver + uses: madhead/semver-utils@v2 + id: version + with: + version: ${{ github.ref_name }} + + - name: Update tags + run: | + TAGS='v${{ steps.version.outputs.major }} v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}' + + for t in $TAGS; do + git tag -f "$t" + git push origin ":$t" 2>/dev/null || true + git push origin "$t" + done