-
-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: updated docTriagers and triager workflow (#2806)
Co-authored-by: Ansh Goyal <[email protected]>
- Loading branch information
1 parent
5ce827d
commit 533366d
Showing
2 changed files
with
22 additions
and
3 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 |
---|---|---|
|
@@ -10,6 +10,25 @@ jobs: | |
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
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[@]}") | ||
|
Validating CODEOWNERS rules …
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