Skip to content

Commit 011a3df

Browse files
mergify[bot]v1v
andauthored
github-actions: use ephemeral tokens (elastic#14303) (elastic#14304)
(cherry picked from commit 2ef32d0) Co-authored-by: Victor Martinez <[email protected]>
1 parent 4aabe6d commit 011a3df

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/add-to-docs-project.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212
if: github.event.label.name == 'Team:Docs'
1313
steps:
14+
- name: Get token
15+
id: get_token
16+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
17+
with:
18+
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
19+
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
20+
permissions: >-
21+
{
22+
"organization_projects": "write",
23+
"issues": "read"
24+
}
1425
- uses: octokit/[email protected]
1526
id: add_to_project
1627
with:
@@ -28,4 +39,4 @@ jobs:
2839
contentid: ${{ github.event.issue.node_id }}
2940
env:
3041
PROJECT_ID: "PVT_kwDOAGc3Zs0iZw"
31-
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
42+
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}

.github/workflows/add-to-project.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ jobs:
1414
name: Add issue to project
1515
runs-on: ubuntu-latest
1616
steps:
17+
- name: Get token
18+
id: get_token
19+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
20+
with:
21+
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
22+
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
23+
permissions: >-
24+
{
25+
"organization_projects": "write",
26+
"issues": "read"
27+
}
1728
- uses: actions/[email protected]
1829
with:
1930
project-url: https://github.com/orgs/elastic/projects/1286
20-
github-token: ${{ secrets.APM_TECH_USER_TOKEN }}
31+
github-token: ${{ steps.get_token.outputs.token }}

0 commit comments

Comments
 (0)