Skip to content

Commit

Permalink
chore: modernize issue/pull labeler action
Browse files Browse the repository at this point in the history
This is based on the more-recently updated labeler.yml in the apm-agent-dotnet repo.

- Switch away from Alex's old unmaintained issue-labeler action.
- Remove old debugging "Show team membership" step.
- Stop assigning the issue to project 454 (and old GH proj we no longer use)
- The hope is that these changes will also close #3884.
  • Loading branch information
trentm committed Mar 9, 2024
1 parent 7a697bc commit c8683aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 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.

32 changes: 8 additions & 24 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,20 @@ 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
# This permission is needed to add labels to issues/PRs per
# https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue
issues: write

jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Add agent-nodejs label to this issue/PR
uses: AlexanderWert/issue-labeler@v2.3
- name: Add agent-nodejs label
uses: actions-ecosystem/action-add-labels@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-config.yml
enable-versioned-regex: 0
labels: agent-nodejs
- name: Check team membership for user
uses: elastic/get-user-teams-membership@1.1.0
id: checkUserMember
Expand All @@ -34,21 +29,10 @@ jobs:
dependabot
dependabot[bot]
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 labels
if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true'
uses: AlexanderWert/issue-labeler@v2.3
uses: actions-ecosystem/action-add-labels@v1
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/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'
column_name: 'In Progress'
labels: |
community
triage

0 comments on commit c8683aa

Please sign in to comment.