Skip to content

Commit b5cbfe3

Browse files
Use GitHub App token in Plan workflow
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ac2caa1 commit b5cbfe3

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/Plan.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ name: Plan
99

1010
on:
1111
workflow_call:
12+
secrets:
13+
GitHubAppClientId:
14+
description: The client ID of the GitHub App used for repository API calls.
15+
required: true
16+
GitHubAppPrivateKey:
17+
description: The private key of the GitHub App used for repository API calls.
18+
required: true
1219
inputs:
1320
SettingsPath:
1421
type: string
@@ -80,9 +87,19 @@ jobs:
8087
path: _wf
8188
persist-credentials: false
8289

90+
- name: Create GitHub App token
91+
id: App-Token
92+
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
93+
with:
94+
app-id: ${{ secrets.GitHubAppClientId }}
95+
private-key: ${{ secrets.GitHubAppPrivateKey }}
96+
8397
- name: Get-Settings
8498
uses: ./_wf/.github/actions/Get-PSModuleSettings
8599
id: Get-Settings
100+
env:
101+
GH_TOKEN: ${{ steps.App-Token.outputs.token }}
102+
GITHUB_TOKEN: ${{ steps.App-Token.outputs.token }}
86103
with:
87104
SettingsPath: ${{ inputs.SettingsPath }}
88105
Debug: ${{ inputs.Debug }}
@@ -96,7 +113,8 @@ jobs:
96113
uses: ./_wf/.github/actions/Resolve-PSModuleVersion
97114
id: Resolve-Version
98115
env:
99-
GH_TOKEN: ${{ github.token }}
116+
GH_TOKEN: ${{ steps.App-Token.outputs.token }}
117+
GITHUB_TOKEN: ${{ steps.App-Token.outputs.token }}
100118
with:
101119
Settings: ${{ steps.Get-Settings.outputs.Settings }}
102120
Name: ${{ fromJson(steps.Get-Settings.outputs.Settings).Name }}

0 commit comments

Comments
 (0)