Skip to content

Commit 77f124d

Browse files
authored
github-actions: use GH app to manage the projects (#359)
1 parent d11ac0d commit 77f124d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/addToProject.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: Auto Assign to Project(s)
33
on:
44
issues:
55
types: [opened, edited, milestoned]
6-
env:
7-
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
86

97
permissions:
108
contents: read
@@ -14,10 +12,24 @@ jobs:
1412
runs-on: ubuntu-latest
1513
name: Assign milestoned to Project
1614
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+
1727
- name: Assign issues with milestones to project
1828
uses: elastic/[email protected]
1929
if: github.event.issue && github.event.issue.milestone
2030
with:
2131
project: 'https://github.com/orgs/elastic/projects/454'
2232
project_id: '5882982'
2333
column_name: 'Planned'
34+
env:
35+
MY_GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}

0 commit comments

Comments
 (0)