Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add workflow to notify docs triagers on relevant PRs #2660

Merged
merged 20 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/notify-triager.yml
TRohit20 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Notify Triage Maintainers

on:
pull_request_target:
types: [opened, reopened, synchronize, edited, ready_for_review]

jobs:
Notify-triagers:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
TRohit20 marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/[email protected]

- name: Check PR Changes for .md files
id: md-pr-changes
uses: tj-actions/changed-filesaa08304bd477b800d468db44fe10f6c61f7f7b11 # 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@v42
TRohit20 marked this conversation as resolved.
Show resolved Hide resolved
akshatnema marked this conversation as resolved.
Show resolved Hide resolved
akshatnema marked this conversation as resolved.
Show resolved Hide resolved
with:
files: |
!**.md

- name: Read triagers.json
id: read-triagers-json
run: |
mdTriagers=$(jq -c '.mdTriagers' triagers.json)
codeTriagers=$(jq -c '.codeTriagers' triagers.json)
echo "md-triagers=$mdTriagers" >> $GITHUB_OUTPUT
echo "code-triagers=$codeTriagers" >> $GITHUB_OUTPUT

- name: Add reviewers for non-.md files
if: steps.non-md-pr-changes.outputs.any_changed == 'true'
run: |
curl \
-X POST \
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
-d '{
"reviewers": ${{ steps.read-triagers-json.outputs.code-triagers }}
TRohit20 marked this conversation as resolved.
Show resolved Hide resolved
}'
- name: Add reviewers for .md files
if: steps.md-pr-changes.outputs.any_changed == 'true'
run: |
curl \
-X POST \
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
-d '{
"reviewers": ${{ steps.read-triagers-json.outputs.md-triagers }}
}'
4 changes: 4 additions & 0 deletions triagers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
TRohit20 marked this conversation as resolved.
Show resolved Hide resolved
"mdTriagers": ["@TRohit20", "@octonawish-akcodes", "@BhaswatiRoy", "@VaishnaviNandakumar", "@Arya-Gupta", "@J0SAL"],
"codeTriagers": ["@sambhavgupta0705"]
}
Loading