From a841191a37335b5857750b6601f9d1f2f630db8c Mon Sep 17 00:00:00 2001 From: Ismar Iljazovic Date: Sun, 15 Dec 2024 18:12:36 +0100 Subject: [PATCH 1/3] release: implement new GitHub release workflow From 87300040c2544af38f2ccc611d4aa44f3cfe6cfa Mon Sep 17 00:00:00 2001 From: Ismar Iljazovic Date: Sun, 15 Dec 2024 18:16:30 +0100 Subject: [PATCH 2/3] add: automatic release label workflow --- .github/workflows/auto-label.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/auto-label.yml diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml new file mode 100644 index 0000000..81d950a --- /dev/null +++ b/.github/workflows/auto-label.yml @@ -0,0 +1,26 @@ +name: Auto Label Release PRs + +on: + pull_request: + types: [opened, synchronize] + branches: [main] + +jobs: + auto-label: + runs-on: ubuntu-latest + permissions: + pull-requests: write + + steps: + - name: Check commit messages and add label + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + # Get all commit messages in the PR + commits=$(gh pr view $PR_NUMBER --json commits --jq '.commits[].messageHeadline') + + # Check if any commit message starts with "release:" + if echo "$commits" | grep -q "^release:"; then + gh pr edit $PR_NUMBER --add-label "release" + fi From 14dc4005912b92c3b0729daeef272f4df6b86107 Mon Sep 17 00:00:00 2001 From: Ismar Iljazovic Date: Sun, 15 Dec 2024 18:18:57 +0100 Subject: [PATCH 3/3] fix: add checkout step to auto-label workflow --- .github/workflows/auto-label.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml index 81d950a..0d013c2 100644 --- a/.github/workflows/auto-label.yml +++ b/.github/workflows/auto-label.yml @@ -12,6 +12,10 @@ jobs: pull-requests: write steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check commit messages and add label env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}