-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.19 KB
/
Copy pathpull-request-labels.yml
File metadata and controls
43 lines (36 loc) · 1.19 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
name: Pull Request Labels
on:
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
concurrency:
group: pull-request-labels-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
issues: write
pull-requests: write
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Check out trusted base revision
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.base.sha }}
fetch-depth: 0
persist-credentials: false
- name: Fetch pull request head without checkout
env:
EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
run: |
git fetch --no-tags origin "pull/${PULL_REQUEST_NUMBER}/head"
test "$(git rev-parse FETCH_HEAD)" = "${EXPECTED_HEAD_SHA}"
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22.13.0
- name: Synchronize pull request labels
run: node .github/scripts/label-pull-request.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}