Skip to content

Commit

Permalink
feat: workflows add add-reviewers.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
liujinye-sys committed Jan 16, 2025
1 parent b46ae67 commit f0e903b
Show file tree
Hide file tree
Showing 2 changed files with 675 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/add-reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Add reviewers Job
run-name: ${{ github.actor }}'s add reviewers job
on:
pull_request:
types: [opened, reopened]

# reusable
workflow_call:

jobs:
onOpenedPullRequest:
runs-on: ubuntu-latest
steps:
- name: Get Reviewers
id: get_reviewers
run: |
REPO_NAME="$(basename ${{ github.repository }})"
if [ ! -z "${{ env.CODEREVIEWERS_URL }}" ];then
wget -O codereviewers.github.json "${{ env.CODEREVIEWERS_URL }}"
REVIEWERS=$(jq -c -r '.'${REPO_NAME}'|map(select(.!="${{ github.actor }}"))' codereviewers.github.json|jq -r '.[]'|tr '\n' ','|sed 's/,$//g')
echo "REVIEWERS=${REVIEWERS}"|tee $GITHUB_ENV
fi
- name: Add Pull Request Reviewers
uses: sakhnovict/[email protected]
with:
reviewers: ${{ env.REVIEWERS }}
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit f0e903b

Please sign in to comment.