forked from cncf/toc
-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (47 loc) · 1.79 KB
/
labeler.yaml
File metadata and controls
52 lines (47 loc) · 1.79 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
52
name: Auto Label Issues and PRs
on:
issues:
types: [opened, edited, reopened, transferred]
issue_comment:
types: [created, edited]
pull_request_target:
types: [opened, edited, reopened]
jobs:
label:
permissions:
contents: read
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
if: ${{ github.event.pull_request }}
id: changed-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c
with:
separator: ","
- name: Run labeler action for PR
if: ${{ github.event.pull_request }}
uses: cncf/automation/.github/actions/labeler-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
labels: https://raw.githubusercontent.com/cncf/toc/refs/heads/main/.github/labels.yaml
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
issue_number: ${{ github.event.pull_request.number }}
comment_body: ${{ github.event.pull_request.body }}
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
- name: Run labeler action for Issue
if: ${{ !github.event.pull_request }}
uses: cncf/automation/.github/actions/labeler-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
labels: https://raw.githubusercontent.com/cncf/toc/refs/heads/main/.github/labels.yaml
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
issue_number: ${{ github.event.issue.number }}
comment_body: ${{ github.event.comment.body }}