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 <[email protected]>
  • Loading branch information
JaydipGabani committed Nov 2, 2023
1 parent 872b770 commit da95441
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 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 }}
28 changes: 17 additions & 11 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
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
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/[email protected]
id: "tag_create"
with:
tag: ${{ env.RELEASE_TAG }}
tag_exists_error: false
# - uses: rickstaa/[email protected]
# id: "tag_create"
# with:
# tag: ${{ env.RELEASE_TAG }}
# tag_exists_error: false

0 comments on commit da95441

Please sign in to comment.