Skip to content

Commit 83568fb

Browse files
Use only GH_TOKEN for app-auth steps
For GitHub App-enabled workflow/action paths, remove dual-token env usage and keep explicit GH_TOKEN-only wiring with no github.token fallback. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent f7ded05 commit 83568fb

7 files changed

Lines changed: 2 additions & 10 deletions

File tree

.github/actions/Cleanup-PSModulePrereleases/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ runs:
2828
working-directory: ${{ inputs.WorkingDirectory }}
2929
env:
3030
GH_TOKEN: ${{ env.GH_TOKEN }}
31-
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
3231
PSMODULE_CLEANUP_PSMODULEPRERELEASES_INPUT_WhatIf: ${{ inputs.WhatIf }}
3332
PSMODULE_CLEANUP_PSMODULEPRERELEASES_CONTEXT_ReleaseTag: ${{ env.PSMODULE_PUBLISH_PSMODULE_CONTEXT_ReleaseTag }}
3433
run: ${{ github.action_path }}/src/cleanup.ps1

.github/actions/Get-PSModuleSettings/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ runs:
5454
id: Get-PSModuleSettings
5555
env:
5656
GH_TOKEN: ${{ env.GH_TOKEN }}
57-
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
5857
PSMODULE_GET_SETTINGS_INPUT_Name: ${{ inputs.Name }}
5958
PSMODULE_GET_SETTINGS_INPUT_SettingsPath: ${{ inputs.SettingsPath }}
6059
PSMODULE_GET_SETTINGS_INPUT_Debug: ${{ inputs.Debug }}
@@ -65,7 +64,7 @@ runs:
6564
PSMODULE_GET_SETTINGS_INPUT_ImportantFilePatterns: ${{ inputs.ImportantFilePatterns }}
6665
with:
6766
Name: Get-PSModuleSettings
68-
Token: ${{ env.GITHUB_TOKEN }}
67+
Token: ${{ env.GH_TOKEN }}
6968
ShowInfo: false
7069
ShowOutput: true
7170
Debug: ${{ inputs.Debug }}

.github/actions/Publish-PSModule/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ runs:
5959
working-directory: ${{ inputs.WorkingDirectory }}
6060
env:
6161
GH_TOKEN: ${{ env.GH_TOKEN }}
62-
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
6362
PSMODULE_PUBLISH_PSMODULE_INPUT_Name: ${{ inputs.Name }}
6463
PSMODULE_PUBLISH_PSMODULE_INPUT_ModulePath: ${{ inputs.ModulePath }}
6564
PSMODULE_PUBLISH_PSMODULE_INPUT_APIKey: ${{ inputs.APIKey }}

.github/actions/Resolve-PSModuleVersion/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ runs:
6666
working-directory: ${{ inputs.WorkingDirectory }}
6767
env:
6868
GH_TOKEN: ${{ env.GH_TOKEN }}
69-
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
7069
PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_Settings: ${{ inputs.Settings }}
7170
PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_Name: ${{ inputs.Name }}
7271
PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_EventJson: ${{ inputs.EventJson }}

.github/workflows/Plan.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ jobs:
9999
id: Get-Settings
100100
env:
101101
GH_TOKEN: ${{ steps.App-Token.outputs.token }}
102-
GITHUB_TOKEN: ${{ steps.App-Token.outputs.token }}
103102
with:
104103
SettingsPath: ${{ inputs.SettingsPath }}
105104
Debug: ${{ inputs.Debug }}
@@ -114,7 +113,6 @@ jobs:
114113
id: Resolve-Version
115114
env:
116115
GH_TOKEN: ${{ steps.App-Token.outputs.token }}
117-
GITHUB_TOKEN: ${{ steps.App-Token.outputs.token }}
118116
with:
119117
Settings: ${{ steps.Get-Settings.outputs.Settings }}
120118
Name: ${{ fromJson(steps.Get-Settings.outputs.Settings).Name }}

.github/workflows/Publish-Module.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ jobs:
5555
uses: ./_wf/.github/actions/Publish-PSModule
5656
env:
5757
GH_TOKEN: ${{ steps.App-Token.outputs.token }}
58-
GITHUB_TOKEN: ${{ steps.App-Token.outputs.token }}
5958
with:
6059
Name: ${{ fromJson(inputs.Settings).Name }}
6160
ModulePath: outputs/module
@@ -71,7 +70,6 @@ jobs:
7170
uses: ./_wf/.github/actions/Cleanup-PSModulePrereleases
7271
env:
7372
GH_TOKEN: ${{ steps.App-Token.outputs.token }}
74-
GITHUB_TOKEN: ${{ steps.App-Token.outputs.token }}
7573
with:
7674
WhatIf: ${{ github.repository == 'PSModule/Process-PSModule' }}
7775
AutoCleanup: ${{ fromJson(inputs.Settings).Publish.Module.AutoCleanup }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
GitHubAppPrivateKey: ${{ secrets.PSMODULE_PRIVATE_KEY }}
3131
```
3232
33-
This is a required contract for GitHub operations in the reusable workflow path; `github.token` fallback is intentionally not used.
33+
This is a required contract for GitHub operations in the reusable workflow path; a GitHub App installation token is minted and used for those steps via `GH_TOKEN`, and `github.token` fallback is intentionally not used.

0 commit comments

Comments
 (0)