-
Notifications
You must be signed in to change notification settings - Fork 293
56 lines (44 loc) · 1.68 KB
/
add-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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: 'Add labels to issues and pull requests'
on:
issues:
types: [ opened ]
pull_request_target:
branches: [ 'main*', 'instrumentation*', 'exporter*', 'extensions*' ]
permissions:
issues: write
pull-requests: write
jobs:
add-labels-on-issues:
if: github.event_name == 'issues' && !github.event.issue.pull_request
runs-on: ubuntu-22.04
steps:
- name: check out code
uses: actions/checkout@v4
- name: Add labels for component found in bug issue descriptions
shell: pwsh
run: |
Import-Module .\build\scripts\add-labels.psm1
AddLabelsOnIssuesForComponentFoundInBody `
-issueNumber ${{ github.event.issue.number }} `
-issueLabels '${{ join(github.event.issue.labels.*.name, ', ') }}' `
-issueBody $env:ISSUE_BODY
env:
GH_TOKEN: ${{ github.token }}
ISSUE_BODY: ${{ github.event.issue.body }}
add-labels-on-pull-requests:
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-22.04
steps:
- name: check out code
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }} # Note: Do not run on the PR branch we want to execute add-labels.psm1 from main on the base repo only because pull_request_target can see secrets
- name: Add labels for files changed on pull requests
shell: pwsh
run: |
Import-Module .\build\scripts\add-labels.psm1
AddLabelsOnPullRequestsBasedOnFilesChanged `
-pullRequestNumber ${{ github.event.pull_request.number }} `
-labelPackagePrefix 'comp:'
env:
GH_TOKEN: ${{ github.token }}