|
4 | 4 | types: [opened]
|
5 | 5 | pull_request_target:
|
6 | 6 | types: [opened]
|
7 |
| -env: |
8 |
| - MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }} |
9 | 7 |
|
| 8 | +# '*: write' permissions for https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue |
10 | 9 | permissions:
|
11 | 10 | contents: read
|
| 11 | + issues: write |
| 12 | + pull-requests: write |
12 | 13 |
|
13 | 14 | jobs:
|
14 | 15 | triage:
|
15 | 16 | runs-on: ubuntu-latest
|
16 | 17 | steps:
|
17 | 18 | - name: Add agent-python label
|
18 |
| - uses: AlexanderWert/[email protected] |
| 19 | + uses: actions-ecosystem/action-add-labels@v1 |
19 | 20 | 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 |
| - |
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 |
26 | 24 | with:
|
27 | 25 | 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 |
40 | 30 | 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 |
| - |
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