File tree 2 files changed +29
-5
lines changed
2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ name: Auto Assign to Project(s)
4
4
on :
5
5
issues :
6
6
types : [opened, edited, milestoned]
7
- env :
8
- MY_GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
9
7
10
8
permissions :
11
9
contents : read
@@ -15,10 +13,24 @@ jobs:
15
13
runs-on : ubuntu-latest
16
14
name : Assign milestoned to Project
17
15
steps :
16
+ - name : Get token
17
+ id : get_token
18
+ uses : tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
19
+ with :
20
+ app_id : ${{ secrets.OBS_AUTOMATION_APP_ID }}
21
+ private_key : ${{ secrets.OBS_AUTOMATION_APP_PEM }}
22
+ permissions : >-
23
+ {
24
+ "organization_projects": "write",
25
+ "issues": "read"
26
+ }
27
+
18
28
- name : Assign issues with milestones to project
19
29
uses : elastic/assign-one-project-github-action@1.2.2
20
30
if : github.event.issue && github.event.issue.milestone
21
31
with :
22
32
project : ' https://github.com/orgs/elastic/projects/454'
23
33
project_id : ' 5882982'
24
34
column_name : ' Planned'
35
+ env :
36
+ MY_GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
Original file line number Diff line number Diff line change 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
10
8
permissions :
11
9
contents : read
22
20
repo-token : " ${{ secrets.GITHUB_TOKEN }}"
23
21
configuration-path : .github/labeler-config.yml
24
22
enable-versioned-regex : 0
23
+ - name : Get token
24
+ id : get_token
25
+ uses : tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
26
+ with :
27
+ app_id : ${{ secrets.OBS_AUTOMATION_APP_ID }}
28
+ private_key : ${{ secrets.OBS_AUTOMATION_APP_PEM }}
29
+ permissions : >-
30
+ {
31
+ "members": "read",
32
+ "organization_projects": "write",
33
+ "issues": "read"
34
+ }
25
35
- name : Check team membership for user
26
36
uses : elastic/get-user-teams-membership@1.1.0
27
37
id : checkUserMember
32
42
apmmachine
33
43
dependabot
34
44
obltmachine
35
- GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
45
+ GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
36
46
- name : Show team membership
37
47
run : |
38
48
echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
51
61
project : ' https://github.com/orgs/elastic/projects/454'
52
62
project_id : ' 5882982'
53
63
column_name : ' In Progress'
64
+ env :
65
+ MY_GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
You can’t perform that action at this time.
0 commit comments