2022-08-23 19:01:12 +00:00
|
|
|
name: Add Community Label
|
|
|
|
|
|
|
|
on:
|
2022-12-15 22:41:03 +00:00
|
|
|
pull_request_target:
|
|
|
|
types: [opened]
|
|
|
|
issues:
|
|
|
|
types: [opened]
|
2022-08-23 19:01:12 +00:00
|
|
|
|
2022-12-15 22:41:03 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-08-23 19:01:12 +00:00
|
|
|
|
2023-01-02 17:28:11 +00:00
|
|
|
permissions: {}
|
|
|
|
|
2022-08-23 19:01:12 +00:00
|
|
|
jobs:
|
2022-12-15 22:41:03 +00:00
|
|
|
verify:
|
|
|
|
name: Verify
|
|
|
|
runs-on: ubuntu-20.04
|
2023-01-02 17:28:11 +00:00
|
|
|
permissions:
|
2023-01-27 07:26:54 +00:00
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
issues: write
|
2022-12-15 22:41:03 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup Node.js
|
2023-01-27 07:26:54 +00:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
|
2022-12-15 22:41:03 +00:00
|
|
|
|
|
|
|
- name: Install Octokit
|
|
|
|
run: npm --prefix .github/workflows/scripts install @octokit/action
|
|
|
|
|
|
|
|
- name: Install Actions Core
|
|
|
|
run: npm --prefix .github/workflows/scripts install @actions/core
|
|
|
|
|
|
|
|
- name: Check if user is a community contributor
|
|
|
|
id: check
|
|
|
|
run: node .github/workflows/scripts/is-community-contributor.js
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: 'If community PR, assign a reviewer'
|
|
|
|
if: github.event.pull_request && steps.check.outputs.is-community == 'yes'
|
|
|
|
uses: shufo/auto-assign-reviewer-by-files@f5f3db9ef06bd72ab6978996988c6462cbdaabf6
|
|
|
|
with:
|
|
|
|
config: '.github/project-community-pr-assigner.yml'
|
|
|
|
token: ${{ secrets.PR_ASSIGN_TOKEN }}
|