Skip to content

Commit

Permalink
adding labels to release PR and triggering on pr merged
Browse files Browse the repository at this point in the history
Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
  • Loading branch information
JaydipGabani committed Nov 2, 2023
1 parent 872b770 commit 2254e34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ jobs:
branch: "release-${{ env.NEWVERSION }}"
base: "${{ env.TARGET_BRANCH }}"
signoff: true
labels: |
release-pr
${{ github.event.inputs.release_version }}
10 changes: 7 additions & 3 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
name: create_tag
on: [push]
on:
pull_request:
types: [closed]

permissions:
contents: write

jobs:
create_tag:
name: "Create tag"
if: contains(github.event.head_commit.message, 'Prepare')
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release-pr')
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.event.head_commit.message }}" | grep -o 'v[^ ,]\+' | sed -n '1p')
RELEASE_TAG=$(echo "$GITHUB_CONTEXT" | jq '.[1]' | tr -d '"')
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Check out code
Expand Down

0 comments on commit 2254e34

Please sign in to comment.