From 533366d59afa0f7837d822d44de8ca6425da7694 Mon Sep 17 00:00:00 2001 From: Akshat Nema <76521428+akshatnema@users.noreply.github.com> Date: Sun, 31 Mar 2024 15:29:03 +0530 Subject: [PATCH] fix: updated docTriagers and triager workflow (#2806) Co-authored-by: Ansh Goyal --- .github/workflows/notify-triager.yml | 23 +++++++++++++++++++++-- CODEOWNERS | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/notify-triager.yml b/.github/workflows/notify-triager.yml index 4697775a3dc5..a25a6686c75f 100644 --- a/.github/workflows/notify-triager.yml +++ b/.github/workflows/notify-triager.yml @@ -10,6 +10,25 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4.1.1 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Get commit message + id: commit-message + run: | + commit_message=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }}) + echo "commit_message=$commit_message" >> $GITHUB_OUTPUT + + - name: Check if last commit is a merge commit + id: check-merge-branch + run: | + if [[ "${{ steps.commit-message.outputs.commit_message }}" == *"Merge branch"* ]]; then + echo "Last commit is a merge commit" + echo "isMergeCommit=true" >> $GITHUB_OUTPUT + else + echo "Last commit message does not contain Merge branch" + echo "isMergeCommit=false" >> $GITHUB_OUTPUT + fi - name: Check PR Changes for .md files id: md-pr-changes @@ -45,7 +64,7 @@ jobs: echo "codeTriagers=$codeTriagers" >> $GITHUB_ENV - name: Add Reviewers for code files - if: steps.non-md-pr-changes.outputs.any_changed == 'true' + if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.non-md-pr-changes.outputs.any_changed == 'true' run: | IFS=' ' read -r -a codeTriagers <<< "${{ env.codeTriagers }}" reviewers=$(printf ', "%s"' "${codeTriagers[@]}") @@ -60,7 +79,7 @@ jobs: }" - name: Add Reviewers for doc files - if: steps.md-pr-changes.outputs.any_changed == 'true' + if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.md-pr-changes.outputs.any_changed == 'true' run: | IFS=' ' read -r -a docTriagers <<< "${{ env.docTriagers }}" reviewers=$(printf ', "%s"' "${docTriagers[@]}") diff --git a/CODEOWNERS b/CODEOWNERS index ea61b1d1d701..54e75c801bdf 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -14,5 +14,5 @@ pages/blog/*.md @thulieblack @alequetzalli pages/community/*.md @thulieblack @alequetzalli README.md @alequetzalli @derberg @akshatnema @magicmatatjahu @mayaleeeee @asyncapi-bot-eve -#docTriagers: TRohit20 octonawish-akcodes BhaswatiRoy VaishnaviNandakumar Arya-Gupta J0SAL +#docTriagers: TRohit20 octonawish-akcodes BhaswatiRoy VaishnaviNandakumar J0SAL #codeTriagers: sambhavgupta0705