-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyml
41 lines (35 loc) · 1.01 KB
/
yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Pull Request Labeler
on:
pull_request_target:
types: [opened, synchronize, labeled, unlabeled]
jobs:
triage:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install dependencies
run: yarn install
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Label pull request
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { context } = github;
const labelName = 'needs review'; // replace with your label name
await github.issues.addLabels({
...context.repo,
issue_number: context.payload.pull_request.number,
labels: [labelName]
});