File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Expand file tree Collapse file tree 2 files changed +31
-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
+ "repository_projects": "write"
24
+ }
25
+
14
26
- name : Get project data
15
27
env :
16
- GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
28
+ GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
17
29
TEAM : Java
18
30
ORGANIZATION : elastic
19
31
PROJECT_NUMBER : 595
49
61
50
62
- name : Add issue to project
51
63
env :
52
- GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
64
+ GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
53
65
ISSUE_ID : ${{ github.event.issue.node_id }}
54
66
run : |
55
67
item_id="$( gh api graphql -f query='
65
77
66
78
- name : Set fields
67
79
env :
68
- GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
80
+ GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
69
81
run : |
70
82
gh api graphql -f query='
71
83
mutation (
Original file line number Diff line number Diff line change @@ -24,12 +24,26 @@ 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
+ "repository_projects": "write"
38
+ }
39
+
27
40
- id : is_elastic_member
28
41
uses : elastic/oblt-actions/github/is-member-of@v1
29
42
with :
30
43
github-org : " elastic"
31
44
github-user : ${{ github.actor }}
32
- github-token : ${{ secrets.APM_TECH_USER_TOKEN }}
45
+ github-token : ${{ steps.get_token.outputs.token }}
46
+
33
47
- name : Add community and triage lables
34
48
if : contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'elastic-renovate-prod[bot]'
35
49
uses : actions/github-script@v7
56
70
57
71
if : contains(steps.is_elastic_member.outputs.result, 'true') && github.event.pull_request
58
72
env :
59
- MY_GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
73
+ MY_GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
60
74
with :
61
75
project : ' https://github.com/orgs/elastic/projects/454'
62
76
project_id : ' 5882982'
You can’t perform that action at this time.
0 commit comments