-
-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed the notify triager workflow
- Loading branch information
1 parent
384da22
commit 76fd8e4
Showing
1 changed file
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
|
||
- name: Get all changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v45 | ||
|
||
- 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 | ||
uses: tj-actions/changed-files@v45 # 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 | ||
}" | ||