Skip to content

Commit

Permalink
ci: update issue labeler workflow
Browse files Browse the repository at this point in the history
Stop using the apm group and custom github action to check if issues are
from internal members or not.

Fixes #2001
  • Loading branch information
xrmx committed Mar 12, 2024
1 parent bab896d commit d6bc1c0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 33 deletions.
5 changes: 0 additions & 5 deletions .github/community-label.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/labeler-config.yml

This file was deleted.

43 changes: 18 additions & 25 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,35 @@ on:
types: [opened]
pull_request_target:
types: [opened]
env:
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}

# 'issues: write' for https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue
permissions:
contents: read
issues: write

jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Add agent-python label
uses: AlexanderWert/issue-labeler@v2.3
uses: actions-ecosystem/action-add-labels@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-config.yml
enable-versioned-regex: 0
- name: Check team membership for user
uses: elastic/get-user-teams-membership@1.1.0
id: checkUserMember
labels: agent-python
- id: is_elastic_member
uses: elastic/apm-pipeline-library/.github/actions/is-member-elastic-org@current
with:
username: ${{ github.actor }}
team: 'apm'
usernamesToExclude: |
apmmachine
dependabot
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_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/issue-labeler@v2.3
token: ${{ secrets.APM_TECH_USER_TOKEN }}
- name: Add community and triage labels
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'apmmachine'
uses: actions-ecosystem/action-add-labels@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/community-label.yml
enable-versioned-regex: 0
labels:
- community
- triage
- name: Assign new internal pull requests to project
if: contains(steps.is_elastic_member.outputs.result, 'true') && github.event.pull_request
uses: elastic/assign-one-project-github-action@1.2.2
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'
Expand Down

0 comments on commit d6bc1c0

Please sign in to comment.