-
Notifications
You must be signed in to change notification settings - Fork 38
36 lines (33 loc) · 1.04 KB
/
pr-labels.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
name: Pull Request Label
on: pull_request
permissions:
contents: read
jobs:
setup-label:
runs-on: ubuntu-latest
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
permissions:
pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Setup
uses: ./tools/github-actions/setup
- name: Determine labels
run: |
LABELS="$(yarn pr-labels --target="${{ github.base_ref || github.ref_name }}")"
echo "LABELS=$LABELS" >> $GITHUB_ENV
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: env.LABELS != '[]'
continue-on-error: true
with:
script: |
const [owner, repo] = '${{ github.repository }}'.split('/');
github.rest.issues.addLabels({
owner,
repo,
issue_number: context.issue.number,
labels: ${{ env.LABELS }}
})