File tree Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 3
3
issues :
4
4
types :
5
5
- opened, milestoned
6
+
6
7
permissions :
7
8
contents : read
8
9
11
12
if : github.event.issue && github.event.issue.milestone
12
13
runs-on : ubuntu-latest
13
14
steps :
15
+ - name : Get token
16
+ id : get_token
17
+ uses : tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
18
+ with :
19
+ app_id : ${{ secrets.OBS_AUTOMATION_APP_ID }}
20
+ private_key : ${{ secrets.OBS_AUTOMATION_APP_PEM }}
21
+ permissions : >-
22
+ {
23
+ "organization_projects": "write",
24
+ "issues": "read"
25
+ }
26
+
14
27
- name : Get project data
15
28
env :
16
- GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
29
+ GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
17
30
TEAM : Java
18
31
ORGANIZATION : elastic
19
32
PROJECT_NUMBER : 595
49
62
50
63
- name : Add issue to project
51
64
env :
52
- GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
65
+ GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
53
66
ISSUE_ID : ${{ github.event.issue.node_id }}
54
67
run : |
55
68
item_id="$( gh api graphql -f query='
65
78
66
79
- name : Set fields
67
80
env :
68
- GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
81
+ GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
69
82
run : |
70
83
gh api graphql -f query='
71
84
mutation (
Original file line number Diff line number Diff line change @@ -24,12 +24,27 @@ jobs:
24
24
repo: context.repo.repo,
25
25
labels: ["agent-java"]
26
26
})
27
+
28
+ - name : Get token
29
+ id : get_token
30
+ uses : tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
31
+ with :
32
+ app_id : ${{ secrets.OBS_AUTOMATION_APP_ID }}
33
+ private_key : ${{ secrets.OBS_AUTOMATION_APP_PEM }}
34
+ permissions : >-
35
+ {
36
+ "members": "read",
37
+ "organization_projects": "write",
38
+ "issues": "read"
39
+ }
40
+
27
41
- id : is_elastic_member
28
42
uses : elastic/oblt-actions/github/is-member-of@v1
29
43
with :
30
44
github-org : " elastic"
31
45
github-user : ${{ github.actor }}
32
- github-token : ${{ secrets.APM_TECH_USER_TOKEN }}
46
+ github-token : ${{ steps.get_token.outputs.token }}
47
+
33
48
- name : Add community and triage lables
34
49
if : contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'elastic-renovate-prod[bot]'
35
50
uses : actions/github-script@v7
56
71
57
72
if : contains(steps.is_elastic_member.outputs.result, 'true') && github.event.pull_request
58
73
env :
59
- MY_GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
74
+ MY_GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
60
75
with :
61
76
project : ' https://github.com/orgs/elastic/projects/454'
62
77
project_id : ' 5882982'
You can’t perform that action at this time.
0 commit comments