From da95441f41b83bcc411fa81d626aa0a1853ea6e0 Mon Sep 17 00:00:00 2001 From: Jaydip Gabani Date: Thu, 2 Nov 2023 03:05:07 +0000 Subject: [PATCH] adding labels to release PR and triggering on pr merged Signed-off-by: Jaydip Gabani --- .github/workflows/release-pr.yaml | 3 +++ .github/workflows/tag.yaml | 28 +++++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-pr.yaml b/.github/workflows/release-pr.yaml index 6dda8e83255..7887aad5a6a 100644 --- a/.github/workflows/release-pr.yaml +++ b/.github/workflows/release-pr.yaml @@ -84,3 +84,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 index d18e3d1d98e..ea4f0199fe9 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -1,5 +1,7 @@ name: create_tag -on: [push] +on: + pull_request: + types: [closed] permissions: contents: write @@ -7,19 +9,23 @@ permissions: jobs: create_tag: name: "Create tag" - if: contains(github.event.head_commit.message, 'Prepare') + if: github.event.pull_request.merged == true runs-on: ubuntu-22.04 steps: - name: "Set release tag" run: | - RELEASE_TAG=$(echo "${{ github.event.head_commit.message }}" | grep -o 'v[^ ,]\+' | sed -n '1p') - echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV + # RELEASE_TAG=$(echo "${{ github.event.head_commit.message }}" | grep -o 'v[^ ,]\+' | sed -n '1p') + # echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV + echo "base ref ${{ github.event.base_ref }}" + echo "ref ${{ github.event.ref }}" + echo "base ref ${{ github.event.pull_request.merged }}" + echo "tag ${{ github.event.pull_request.labels.*.name }}" - - name: Check out code - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 + # - name: Check out code + # uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 - - uses: rickstaa/action-create-tag@v1.6.4 - id: "tag_create" - with: - tag: ${{ env.RELEASE_TAG }} - tag_exists_error: false + # - uses: rickstaa/action-create-tag@v1.6.4 + # id: "tag_create" + # with: + # tag: ${{ env.RELEASE_TAG }} + # tag_exists_error: false