-
Notifications
You must be signed in to change notification settings - Fork 76
65 lines (63 loc) · 2.21 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
57
58
59
60
61
62
63
64
65
name: "Issue Labeler"
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
permissions:
contents: read
issues: write
pull-requests: write
jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Add agent-java label
uses: AlexanderWert/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-config.yml
enable-versioned-regex: 0
- 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: >-
{
"members": "read",
"organization_projects": "write",
"issues": "read"
}
- name: Check team membership for user
uses: elastic/[email protected]
id: checkUserMember
with:
username: ${{ github.actor }}
team: 'apm'
usernamesToExclude: |
apmmachine
dependabot
obltmachine
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
- name: Show team membership
run: |
echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
echo "::debug::isExcluded: ${{ steps.checkUserMember.outputs.isExcluded }}"
- name: Add community and triage lables
if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true'
uses: AlexanderWert/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/community-label.yml
enable-versioned-regex: 0
- name: Assign new internal pull requests to project
uses: elastic/[email protected]
if: (steps.checkUserMember.outputs.isTeamMember == 'true' || steps.checkUserMember.outputs.isExcluded == 'true') && github.event.pull_request
with:
project: 'https://github.com/orgs/elastic/projects/454'
project_id: '5882982'
column_name: 'In Progress'
env:
MY_GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}