Skip to content

Commit

Permalink
fix: fixed the notify triager workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sambhavgupta0705 committed Dec 9, 2024
1 parent 384da22 commit 76fd8e4
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/notify-triager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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[@]}")
Expand All @@ -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[@]}")
Expand All @@ -96,3 +97,4 @@ jobs:
-d "{
\"reviewers\": $reviewers
}"

0 comments on commit 76fd8e4

Please sign in to comment.