Skip to content

Commit 6835015

Browse files
committed
fix: Allow both api-token and ssh-key together
SSH key can be used for git operations while token is used for GitHub API calls (gh commands, PR creation, etc). This is a valid and useful configuration.
1 parent 62a7a9d commit 6835015

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

updater/action.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ inputs:
3434
required: false
3535
default: ''
3636
api-token:
37-
description: 'Token for the repo. Can be passed in using {{ secrets.GITHUB_TOKEN }}. Not required if ssh-key is provided.'
37+
description: 'Token for the repo. Can be passed in using {{ secrets.GITHUB_TOKEN }}. Not required if ssh-key is provided, but can be used together with ssh-key for GitHub API operations.'
3838
required: false
3939
default: ''
4040
ssh-key:
41-
description: 'SSH private key for repository authentication. Alternative to api-token. Use for deploy key authentication.'
41+
description: 'SSH private key for repository authentication. Can be used alone or together with api-token (SSH for git, token for GitHub API).'
4242
required: false
4343
default: ''
4444
post-update-script:
@@ -136,17 +136,16 @@ runs:
136136
exit 1
137137
}
138138
139-
if ($hasToken -and $hasSshKey) {
140-
Write-Output "::error::Both api-token and ssh-key were provided. Please provide only one."
141-
exit 1
142-
}
143-
144139
if ($hasToken -and $env:GH_TOKEN -match '-----BEGIN') {
145140
Write-Output "::error::The api-token input appears to contain an SSH private key."
146141
Write-Output "::error::Please use the ssh-key input for SSH authentication instead of api-token."
147142
exit 1
148143
}
149144
145+
if ($hasToken -and $hasSshKey) {
146+
Write-Output "Using both SSH key (for git) and token (for GitHub API)"
147+
}
148+
150149
# Token-specific validation
151150
if ($hasToken) {
152151
if ($env:GH_TOKEN -match '\s') {

0 commit comments

Comments
 (0)