2022-08-23 19:01:12 +00:00
|
|
|
name: Add Community Label
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request_target:
|
|
|
|
types: [opened]
|
2022-10-09 22:34:52 +00:00
|
|
|
issues:
|
|
|
|
types: [opened]
|
|
|
|
|
2022-08-23 19:01:12 +00:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
verify:
|
|
|
|
name: Verify
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-10-09 22:34:52 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-23 19:01:12 +00:00
|
|
|
|
2022-10-09 22:34:52 +00:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93
|
2022-08-23 19:01:12 +00:00
|
|
|
|
2022-10-09 22:34:52 +00:00
|
|
|
- name: Install Octokit
|
|
|
|
run: npm --prefix .github/workflows/scripts install @octokit/action
|
|
|
|
|
|
|
|
- name: Check if user is a community contributor
|
2022-10-13 19:19:36 +00:00
|
|
|
id: check
|
2022-10-09 22:34:52 +00:00
|
|
|
run: node .github/workflows/scripts/is-community-contributor.js
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-10-13 19:19:36 +00:00
|
|
|
|
|
|
|
- name: "If community PR, assign a reviewer"
|
|
|
|
if: github.event.pull_request && steps.check.outputs.is-community == 'yes'
|
2022-10-14 19:23:39 +00:00
|
|
|
uses: shufo/auto-assign-reviewer-by-files@f5f3db9ef06bd72ab6978996988c6462cbdaabf6
|
2022-10-13 19:19:36 +00:00
|
|
|
with:
|
|
|
|
config: ".github/project-community-pr-assigner.yml"
|
2022-10-18 14:20:22 +00:00
|
|
|
token: ${{ secrets.PR_ASSIGN_TOKEN }}
|