-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
33 lines (33 loc) · 1.22 KB
/
new_pr_labeler.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
name: new_pr_labeler
on:
pull_request_target:
types:
- opened
env:
NODE_VERSION: '20'
jobs:
label_pr:
# Continue only if the PR is not a draft, and was opened in the same repository that is running this action:
if: ${{ github.repository == github.event.repository.full_name && !github.event.pull_request.draft}}
permissions:
contents: read
issues: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/cache@v4
id: cache-octokit
with:
path: 'node_modules'
# Cache key shared across workflows
key: ${{ runner.os }}-node${{ env.NODE_VERSION}}-octokit-${{ hashFiles('**/package-lock.json') }}
- if: steps.cache-octokit.outputs.cache-hit != 'true'
run: npm install @octokit/action
- run: node scripts/gh_scripts/new_pr_labeler.mjs ${{ github.repository }} ${{ github.event.pull_request.user.login }} ${{ github.event.pull_request.number }} "$PR_BODY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BODY: ${{ github.event.pull_request.body }}