File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
hugoalh.GitHubActionsToolkit Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -677,24 +677,18 @@ function Get-GitHubActionsOidcToken {
677
677
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_get-githubactionsoidctoken#Get-GitHubActionsOidcToken' )]
678
678
[OutputType ([string ])]
679
679
param (
680
- [Parameter (Position = 0 )][AllowNull ()][ string ]$Audience
680
+ [Parameter (Position = 0 )][string ]$Audience
681
681
)
682
682
[string ]$OidcTokenRequestToken = $env: ACTIONS_ID_TOKEN_REQUEST_TOKEN
683
683
[string ]$OidcTokenRequestURL = $env: ACTIONS_ID_TOKEN_REQUEST_URL
684
- if (
685
- $null -eq $OidcTokenRequestToken -or
686
- $OidcTokenRequestToken.Length -eq 0
687
- ) {
684
+ if ($OidcTokenRequestToken.Length -eq 0 ) {
688
685
return Write-Error - Message ' Unable to get GitHub Actions OIDC token request token!' - Category ' ResourceUnavailable'
689
686
}
690
687
Add-GitHubActionsSecretMask - Value $OidcTokenRequestToken
691
- if (
692
- $null -eq $OidcTokenRequestURL -or
693
- $OidcTokenRequestURL.Length -eq 0
694
- ) {
688
+ if ($OidcTokenRequestURL.Length -eq 0 ) {
695
689
return Write-Error - Message ' Unable to get GitHub Actions OIDC token request URL!' - Category ' ResourceUnavailable'
696
690
}
697
- if ($null -ne $Audience -and $ Audience.Length -gt 0 ) {
691
+ if ($Audience.Length -gt 0 ) {
698
692
Add-GitHubActionsSecretMask - Value $Audience
699
693
[string ]$AudienceEncode = [System.Web.HttpUtility ]::UrlEncode($Audience )
700
694
Add-GitHubActionsSecretMask - Value $AudienceEncode
You can’t perform that action at this time.
0 commit comments