Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mazhelez authored Sep 22, 2023
2 parents 23ac9fb + af43105 commit 5314bfb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Actions/AL-Go-Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ function GetBcContainerHelperPath([string] $bcContainerHelperVersion) {
}
}
$env:BcContainerHelperPath = $bcContainerHelperPath
Add-Content -Encoding UTF8 -Path $ENV:GITHUB_ENV "BcContainerHelperPath=$bcContainerHelperPath"
if ($ENV:GITHUB_ENV) {
Add-Content -Encoding UTF8 -Path $ENV:GITHUB_ENV "BcContainerHelperPath=$bcContainerHelperPath"
}
return $bcContainerHelperPath
}

Expand Down
10 changes: 8 additions & 2 deletions Actions/DetermineArtifactUrl/DetermineArtifactUrl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ try {

#region Action: Determine artifacts to use
$telemetryScope = CreateScope -eventId 'DO0084' -parentTelemetryScopeJson $parentTelemetryScopeJson
$secrets = $env:Secrets | ConvertFrom-Json | ConvertTo-HashTable
$insiderSasToken = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($secrets.insiderSasToken))

$insiderSasToken = ""
# ENV:Secrets is not set when running Pull_Request trigger
if ($env:Secrets) {
$secrets = $env:Secrets | ConvertFrom-Json | ConvertTo-HashTable
$insiderSasToken = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($secrets.insiderSasToken))
}

$settings = $env:Settings | ConvertFrom-Json | ConvertTo-HashTable
$settings = AnalyzeRepo -settings $settings -project $project -doNotCheckArtifactSetting -doNotIssueWarnings
$artifactUrl = DetermineArtifactUrl -projectSettings $settings -insiderSasToken $insiderSasToken
Expand Down
9 changes: 8 additions & 1 deletion Actions/RunPipeline/RunPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ try {

Write-Host "use settings and secrets"
$settings = $env:Settings | ConvertFrom-Json | ConvertTo-HashTable
$secrets = $env:Secrets | ConvertFrom-Json | ConvertTo-HashTable
# ENV:Secrets is not set when running Pull_Request trigger
if ($env:Secrets) {
$secrets = $env:Secrets | ConvertFrom-Json | ConvertTo-HashTable
}
else {
$secrets = @{}
}

$appBuild = $settings.appBuild
$appRevision = $settings.appRevision
'licenseFileUrl','insiderSasToken','codeSignCertificateUrl','*codeSignCertificatePassword','keyVaultCertificateUrl','*keyVaultCertificatePassword','keyVaultClientId','gitHubPackagesContext','applicationInsightsConnectionString' | ForEach-Object {
Expand Down

0 comments on commit 5314bfb

Please sign in to comment.