File tree Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Expand file tree Collapse file tree 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)
44on :
55 issues :
66 types : [opened, edited, milestoned]
7- env :
8- MY_GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
97
108permissions :
119 contents : read
@@ -15,10 +13,24 @@ jobs:
1513 runs-on : ubuntu-latest
1614 name : Assign milestoned to Project
1715 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+
1828 - name : Assign issues with milestones to project
19292030 if : github.event.issue && github.event.issue.milestone
2131 with :
2232 project : ' https://github.com/orgs/elastic/projects/454'
2333 project_id : ' 5882982'
2434 column_name : ' Planned'
35+ env :
36+ MY_GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
Original file line number Diff line number Diff line change 44 types : [opened]
55 pull_request_target :
66 types : [opened]
7- env :
8- MY_GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
97
108permissions :
119 contents : read
2220 repo-token : " ${{ secrets.GITHUB_TOKEN }}"
2321 configuration-path : .github/labeler-config.yml
2422 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+ }
2535 - name : Check team membership for user
26362737 id : checkUserMember
3242 apmmachine
3343 dependabot
3444 obltmachine
35- GITHUB_TOKEN : ${{ secrets.APM_TECH_USER_TOKEN }}
45+ GITHUB_TOKEN : ${{ steps.get_token.outputs.token }}
3646 - name : Show team membership
3747 run : |
3848 echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
5161 project : ' https://github.com/orgs/elastic/projects/454'
5262 project_id : ' 5882982'
5363 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