Skip to content

Commit 165a73b

Browse files
xrmxreakaleek
andauthored
ci: update issue labeler (#2003)
* ci: update issue labeler workflow Stop using the apm group and custom github action to check if issues are from internal members or not. While at it remove posting internal pull requests on the old APM agent board. Fixes #2001 * Update .github/workflows/labeler.yml Co-authored-by: Jan Calanog <[email protected]> --------- Co-authored-by: Jan Calanog <[email protected]>
1 parent 11b59b2 commit 165a73b

File tree

3 files changed

+18
-39
lines changed

3 files changed

+18
-39
lines changed

.github/community-label.yml

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

.github/labeler-config.yml

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

.github/workflows/labeler.yml

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,30 @@ on:
44
types: [opened]
55
pull_request_target:
66
types: [opened]
7-
env:
8-
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
7+
8+
# 'issues: write' for https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue
9+
permissions:
10+
contents: read
11+
issues: write
12+
pull-requests: write
13+
914
jobs:
1015
triage:
1116
runs-on: ubuntu-latest
1217
steps:
1318
- name: Add agent-python label
14-
uses: AlexanderWert/[email protected]
19+
uses: actions-ecosystem/action-add-labels@v1
1520
with:
16-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
17-
configuration-path: .github/labeler-config.yml
18-
enable-versioned-regex: 0
19-
- name: Check team membership for user
20-
uses: elastic/[email protected]
21-
id: checkUserMember
21+
labels: agent-python
22+
- id: is_elastic_member
23+
uses: elastic/apm-pipeline-library/.github/actions/is-member-elastic-org@current
2224
with:
2325
username: ${{ github.actor }}
24-
team: 'apm'
25-
usernamesToExclude: |
26-
apmmachine
27-
dependabot
28-
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
29-
- name: Show team membership
30-
run: |
31-
echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
32-
echo "::debug::isExcluded: ${{ steps.checkUserMember.outputs.isExcluded }}"
33-
- name: Add community and triage lables
34-
if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true'
35-
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
3630
with:
37-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
38-
configuration-path: .github/community-label.yml
39-
enable-versioned-regex: 0
40-
- name: Assign new internal pull requests to project
41-
uses: elastic/[email protected]
42-
if: (steps.checkUserMember.outputs.isTeamMember == 'true' || steps.checkUserMember.outputs.isExcluded == 'true') && github.event.pull_request
43-
with:
44-
project: 'https://github.com/orgs/elastic/projects/454'
45-
project_id: '5882982'
46-
column_name: 'In Progress'
31+
labels:
32+
- community
33+
- triage

0 commit comments

Comments
 (0)