Skip to content

Commit

Permalink
chore: auto tagging after release pr is merged (#3135)
Browse files Browse the repository at this point in the history
Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
  • Loading branch information
JaydipGabani and sozercan committed Dec 1, 2023
1 parent 2370c50 commit 792bbe4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,6 @@ jobs:
branch: "release-${{ env.NEWVERSION }}"
base: "${{ env.TARGET_BRANCH }}"
signoff: true
labels: |
release-pr
${{ github.event.inputs.release_version }}
28 changes: 28 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 792bbe4

Please sign in to comment.