From 7be1bfc70fd2d975b7073d8135a14354d6d6ad6a Mon Sep 17 00:00:00 2001 From: akshatnema Date: Sat, 23 Mar 2024 16:59:13 +0530 Subject: [PATCH 1/4] updated docTriagers and triager workflow --- .github/workflows/notify-triager.yml | 1 + CODEOWNERS | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/notify-triager.yml b/.github/workflows/notify-triager.yml index 4697775a3dc..b48e1798dd4 100644 --- a/.github/workflows/notify-triager.yml +++ b/.github/workflows/notify-triager.yml @@ -6,6 +6,7 @@ on: jobs: Notify-triagers: + if: ! contains(github.event.pull_request.head.sha, 'Merge branch') runs-on: ubuntu-latest steps: - name: Checkout Repository diff --git a/CODEOWNERS b/CODEOWNERS index ea61b1d1d70..54e75c801bd 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 From c02acc56a84118b996831bdff4857c88184df071 Mon Sep 17 00:00:00 2001 From: akshatnema Date: Sun, 24 Mar 2024 23:09:18 +0530 Subject: [PATCH 2/4] updated workflow --- .github/workflows/notify-triager.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/notify-triager.yml b/.github/workflows/notify-triager.yml index b48e1798dd4..a08638cc5f3 100644 --- a/.github/workflows/notify-triager.yml +++ b/.github/workflows/notify-triager.yml @@ -6,12 +6,28 @@ on: jobs: Notify-triagers: - if: ! contains(github.event.pull_request.head.sha, 'Merge branch') runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4.1.1 + - 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 "skip" >> $GITHUB_OUTPUT + else + echo "Last commit message does not contain Merge branch" + echo "proceed" >> $GITHUB_OUTPUT + fi + - name: Check PR Changes for .md files id: md-pr-changes uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0 From bdc61d18551ed2e66ed669ae5026648389db9dbd Mon Sep 17 00:00:00 2001 From: Ansh Goyal Date: Tue, 26 Mar 2024 09:49:47 +0530 Subject: [PATCH 3/4] Apply suggestions from code review --- .github/workflows/notify-triager.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify-triager.yml b/.github/workflows/notify-triager.yml index a08638cc5f3..4f293c9eebd 100644 --- a/.github/workflows/notify-triager.yml +++ b/.github/workflows/notify-triager.yml @@ -15,7 +15,7 @@ jobs: 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 + echo "commit_message=$commit_message" >> $GITHUB_OUTPUT - name: Check if last commit is a merge commit id: check-merge-branch From 8128c5429f19f160df280bcaa955f8acf8c95c76 Mon Sep 17 00:00:00 2001 From: akshatnema Date: Sun, 31 Mar 2024 10:38:00 +0530 Subject: [PATCH 4/4] updated workflow to add conditions for merge commit --- .github/workflows/notify-triager.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/notify-triager.yml b/.github/workflows/notify-triager.yml index 4f293c9eebd..a25a6686c75 100644 --- a/.github/workflows/notify-triager.yml +++ b/.github/workflows/notify-triager.yml @@ -10,6 +10,8 @@ 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 @@ -20,12 +22,12 @@ jobs: - name: Check if last commit is a merge commit id: check-merge-branch run: | - if [[ ${{ steps.commit-message.outputs.commit_message }} == *"Merge branch"* ]]; then + if [[ "${{ steps.commit-message.outputs.commit_message }}" == *"Merge branch"* ]]; then echo "Last commit is a merge commit" - echo "skip" >> $GITHUB_OUTPUT + echo "isMergeCommit=true" >> $GITHUB_OUTPUT else echo "Last commit message does not contain Merge branch" - echo "proceed" >> $GITHUB_OUTPUT + echo "isMergeCommit=false" >> $GITHUB_OUTPUT fi - name: Check PR Changes for .md files @@ -62,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[@]}") @@ -77,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[@]}")