diff --git a/.github/workflows/notify-triager.yml b/.github/workflows/notify-triager.yml index bcdd6ef3d352..6a7ae1146599 100644 --- a/.github/workflows/notify-triager.yml +++ b/.github/workflows/notify-triager.yml @@ -17,7 +17,10 @@ jobs: - name: Get commit message id: commit-message run: | + # Extract the commit message commit_message=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }}) + commit_message=$(echo "$commit_message" | tr '\n' ' ') + commit_message=$(echo "$commit_message" | sed 's/[<>|]//g' | sed 's/[][]//g' | sed 's/(//g' | sed 's/)//g' | xargs) echo "commit_message=$commit_message" >> $GITHUB_OUTPUT - name: Check if last commit is a merge commit @@ -34,19 +37,17 @@ jobs: - name: Checkout asyncapi/website Repository uses: actions/checkout@v4.1.1 + - name: Get all changed files + id: changed-files + uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 + - 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 with: files: | **.md - - - name: Check PR Changes for non-.md files - id: non-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 - with: - files: | - !**.md + - name: Extract Doc Triage Maintainers @@ -68,7 +69,7 @@ jobs: echo "codeTriagers=$codeTriagers" >> $GITHUB_ENV - name: Add Reviewers for code files - if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.non-md-pr-changes.outputs.any_changed == 'true' + if: ${{ steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.changed-files.outputs.all_changed_files_count != steps.md-pr-changes.outputs.all_changed_files_count }} run: | IFS=' ' read -r -a codeTriagers <<< "${{ env.codeTriagers }}" reviewers=$(printf ', "%s"' "${codeTriagers[@]}") @@ -83,7 +84,7 @@ jobs: }" - name: Add Reviewers for doc files - if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && 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[@]}") @@ -96,3 +97,4 @@ jobs: -d "{ \"reviewers\": $reviewers }" +