Skip to content

🩹 [Patch]: Make store 0.3 compatible #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix
  • Loading branch information
MariusStorhaug committed Nov 9, 2024
commit 30f4dbde065733b58d8093a2a89c1cd340bafc66
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ inputs:
Token:
description: The access token to use.
required: false
default: ${{ github.token }}
Debug:
description: Enable debug output.
required: false
Expand Down
13 changes: 1 addition & 12 deletions scripts/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,15 @@ if (-not $alreadyImported) {
}
'::endgroup::'


$runningOnGitHubActions = $env:GITHUB_ACTIONS -eq 'true'
$tokenNotProvided = [string]::IsNullOrEmpty($Token)
$gitHubToken = $env:GH_TOKEN ?? $env:GITHUB_TOKEN
$gitHubTokenPresent = -not [string]::IsNullOrEmpty($gitHubToken)
Write-Verbose "GitHub Actions: [$runningOnGitHubActions]"
Write-Verbose "Token provided: [$tokenNotProvided]"
Write-Verbose "GitHub token present: [$gitHubTokenPresent] ($gitHubToken)"

LogGroup 'Connect-Github' {
if (-not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token)) {
Write-Verbose "Setting GITHUB_TOKEN to provided input 'Token'"
Connect-Github -Token $env:GITHUB_ACTION_INPUT_Token
} elseif (-not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) -and -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PEM)) {
} elseif (-not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) -and -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey)) {
Write-Verbose "Setting ClientID and PEM to provided inputs 'ClientID' and 'PEM'"
Connect-Github -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey
} elseif (-not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_JWT)) {
Write-Verbose "Setting JWT to provided input 'JWT'"
Connect-Github -JWT $env:GITHUB_ACTION_INPUT_JWT
} else {
Connect-GitHub
}
}