-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (52 loc) · 1.89 KB
/
labeler.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
# Tweak incoming issues/PRs: labeling and/or adding to GH projects.
name: "labeler"
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
# '*: write' permissions for https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue
permissions:
contents: read
issues: write
pull-requests: write
jobs:
categorize-issues-and-prs:
runs-on: ubuntu-latest
steps:
- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"issues": "write",
"members": "read",
"organization_projects": "write",
"pull_requests": "write"
}
- id: is_elastic_member
uses: elastic/oblt-actions/github/is-member-of@v1
with:
github-org: "elastic"
github-user: ${{ github.actor }}
github-token: ${{ steps.get_token.outputs.token }}
- name: Add community and triage labels
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'elastic-renovate-prod[bot]'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["community", "triage"]
})
- name: Assign new internal issues and PRs to project
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
if: contains(steps.is_elastic_member.outputs.result, 'true')
with:
project-url: 'https://github.com/orgs/elastic/projects/1397'
github-token: ${{ steps.get_token.outputs.token }}