diff --git a/.github/workflows/release-pr.yaml b/.github/workflows/release-pr.yaml index 8beaefabfc9..e23d547722a 100644 --- a/.github/workflows/release-pr.yaml +++ b/.github/workflows/release-pr.yaml @@ -85,3 +85,6 @@ jobs: branch: "release-${{ env.NEWVERSION }}" base: "${{ env.TARGET_BRANCH }}" signoff: true + labels: | + release-pr + ${{ github.event.inputs.release_version }} diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml new file mode 100644 index 00000000000..1660271b143 --- /dev/null +++ b/.github/workflows/tag.yaml @@ -0,0 +1,28 @@ +name: create_tag +on: + pull_request: + types: [closed] + +permissions: + contents: write + +jobs: + create_tag: + name: "Create tag" + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release-pr') && startsWith(github.event.pull_request.title, format('chore{0} Prepare', ':')) + runs-on: ubuntu-22.04 + steps: + - name: "Set release tag" + env: + GITHUB_CONTEXT: ${{ toJson(github.event.pull_request.labels.*.name) }} + run: | + RELEASE_TAG=$(echo "$GITHUB_CONTEXT" | jq '.[1]' | tr -d '"') + echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV + + - name: Check out code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 + + - uses: rickstaa/action-create-tag@861755f3fcbce1b21a65c17bad10e7d35c27b6d9 #v1.7.1 + with: + tag: ${{ env.RELEASE_TAG }} + tag_exists_error: false