Skip to content

Commit

Permalink
github-actions: use ephemeral tokens with the right permissions (#1663)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Oct 8, 2024
1 parent 0b20e23 commit 3f69558
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/addToAPMProject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ jobs:
runs-on: ubuntu-latest
name: Assign issues to APM Project for the Server Team
steps:
- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
installation_retrieval_mode: organization
installation_retrieval_payload: elastic
permissions: >-
{
"organization_projects": "write",
"issues": "read"
}
- uses: octokit/[email protected]
id: add_to_project
with:
Expand All @@ -28,7 +42,8 @@ jobs:
contentid: ${{ github.event.issue.node_id }}
env:
PROJECT_ID: "PVT_kwDOAGc3Zs0VSg"
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}

- uses: octokit/[email protected]
id: label_team
with:
Expand All @@ -51,4 +66,4 @@ jobs:
value: "6c538d8a"
env:
PROJECT_ID: "PVT_kwDOAGc3Zs0VSg"
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}

0 comments on commit 3f69558

Please sign in to comment.