-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (44 loc) · 1.63 KB
/
Copy pathlabeler.yml
File metadata and controls
51 lines (44 loc) · 1.63 KB
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
42
43
44
45
46
47
48
49
50
51
name: labeler
on:
pull_request_target:
types: [opened, synchronize, reopened, edited]
permissions:
contents: read
pull-requests: write
issues: read
concurrency:
group: labeler-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
label:
runs-on: ubuntu-latest
steps:
# Apply directory-based labels using changes files and .github/labeler.yml
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: true
- name: Apply type labels from PR title
uses: github/issue-labeler@v3.4
with:
configuration-path: .github/pr-title-labeler.yml
enable-versioned-regex: 0
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: 0
include-title: 1
include-body: 0
# Checkout out only the base branch's .github/scripts directory.
# DO NOT check out the PR head, because pull_request_target runs with
# elevated token permissions and PR-authored code must not be executed.
- uses: actions/checkout@v4
with:
sparse-checkout: .github/scripts
# Copy P- (priority) labels from issues that GitHub links to this PR via
# closing keywords such as "Closes #XXX". Area (A-) and type (T-) come
# from the file/title labelers above, so they are not copied here.
- name: Copy priority labels from linked issues
uses: actions/github-script@v7
with:
script: |
const copyLabels = require('./.github/scripts/copy-linked-issue-labels.js');
await copyLabels({ github, context, core });