Skip to content

Commit 7ec1603

Browse files
authored
ci: fix issue labeler (#111)
Use the same config as in apm agent python: consider everyone from elastic as internal and stop adding issues to the old board.
1 parent dfd960f commit 7ec1603

File tree

2 files changed

+14
-35
lines changed

2 files changed

+14
-35
lines changed

.github/labeler-config.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/labeler.yml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,30 @@ on:
44
types: [opened]
55
pull_request_target:
66
types: [opened]
7-
env:
8-
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
97

8+
# '*: write' permissions for https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue
109
permissions:
1110
contents: read
11+
issues: write
12+
pull-requests: write
1213

1314
jobs:
1415
triage:
1516
runs-on: ubuntu-latest
1617
steps:
1718
- name: Add agent-python label
18-
uses: AlexanderWert/[email protected]
19+
uses: actions-ecosystem/action-add-labels@v1
1920
with:
20-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
21-
configuration-path: .github/labeler-config.yml
22-
enable-versioned-regex: 0
23-
- name: Check team membership for user
24-
uses: elastic/[email protected]
25-
id: checkUserMember
21+
labels: agent-python
22+
- id: is_elastic_member
23+
uses: elastic/apm-pipeline-library/.github/actions/is-member-elastic-org@current
2624
with:
2725
username: ${{ github.actor }}
28-
team: 'apm'
29-
usernamesToExclude: |
30-
apmmachine
31-
dependabot
32-
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
33-
- name: Show team membership
34-
run: |
35-
echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
36-
echo "::debug::isExcluded: ${{ steps.checkUserMember.outputs.isExcluded }}"
37-
- name: Add community and triage lables
38-
if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true'
39-
uses: AlexanderWert/[email protected]
26+
token: ${{ secrets.APM_TECH_USER_TOKEN }}
27+
- name: Add community and triage labels
28+
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'apmmachine'
29+
uses: actions-ecosystem/action-add-labels@v1
4030
with:
41-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
42-
configuration-path: .github/community-label.yml
43-
enable-versioned-regex: 0
44-
- name: Assign new internal pull requests to project
45-
uses: elastic/[email protected]
46-
if: (steps.checkUserMember.outputs.isTeamMember == 'true' || steps.checkUserMember.outputs.isExcluded == 'true') && github.event.pull_request
47-
with:
48-
project: 'https://github.com/orgs/elastic/projects/454'
49-
project_id: '5882982'
50-
column_name: 'In Progress'
51-
31+
labels: |
32+
community
33+
triage

0 commit comments

Comments
 (0)