Skip to content

Commit

Permalink
github-actions: use ephemeral tokens (#14303)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Oct 8, 2024
1 parent 3dfdced commit 2ef32d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/add-to-docs-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ jobs:
runs-on: ubuntu-latest
if: github.event.label.name == 'Team:Docs'
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 }}
permissions: >-
{
"organization_projects": "write",
"issues": "read"
}
- uses: octokit/graphql-action@v2.x
id: add_to_project
with:
Expand All @@ -28,4 +39,4 @@ jobs:
contentid: ${{ github.event.issue.node_id }}
env:
PROJECT_ID: "PVT_kwDOAGc3Zs0iZw"
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
13 changes: 12 additions & 1 deletion .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ jobs:
name: Add issue to project
runs-on: ubuntu-latest
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 }}
permissions: >-
{
"organization_projects": "write",
"issues": "read"
}
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/elastic/projects/1286
github-token: ${{ secrets.APM_TECH_USER_TOKEN }}
github-token: ${{ steps.get_token.outputs.token }}

0 comments on commit 2ef32d0

Please sign in to comment.