Skip to content

Commit

Permalink
handle empty dry-run input event in scheduled runs
Browse files Browse the repository at this point in the history
  • Loading branch information
awakecoding committed Jan 15, 2024
1 parent b5440e8 commit 0fa0967
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ jobs:
run: |
$IsMasterBranch = ('${{ github.ref_name }}' -eq 'master')
$IsScheduledJob = ('${{ github.event_name }}' -eq 'schedule')
$DryRun = [System.Boolean]::Parse('${{ inputs.dry-run }}')
if ('${{ github.event_name }}' -Eq 'schedule') {
}
try { $DryRun = [System.Boolean]::Parse('${{ inputs.dry-run }}') } catch { $DryRun = $true }
$PackageEnv = if ($IsMasterBranch -And -Not $IsScheduledJob) {
"publish-prod"
Expand All @@ -60,7 +65,7 @@ jobs:
$DryRun = $true # force dry run for scheduled runs
}
$PackageVersion = '${{ github.event.inputs.version }}'
$PackageVersion = '${{ inputs.version }}'
if ([string]::IsNullOrEmpty($PackageVersion) -or $PackageVersion -eq 'latest') {
$PackageVersion = (Get-Date -Format "yyyy.MM.dd") + ".0"
}
Expand Down

0 comments on commit 0fa0967

Please sign in to comment.