|
4 | 4 | types: [opened] |
5 | 5 | pull_request_target: |
6 | 6 | 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 | + |
9 | 14 | jobs: |
10 | 15 | triage: |
11 | 16 | runs-on: ubuntu-latest |
12 | 17 | steps: |
13 | 18 | - name: Add agent-python label |
14 | | - uses: AlexanderWert/[email protected] |
| 19 | + uses: actions-ecosystem/action-add-labels@v1 |
15 | 20 | 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 | | - |
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 |
22 | 24 | with: |
23 | 25 | 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 |
36 | 30 | 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 | | - |
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