Skip to content

Commit 845ef32

Browse files
committed
Skip version /p: args on PR builds when GitVersion step is skipped
The Compute version properties step is gated by 'github.event_name != pull_request', so on PR runs steps.version.outputs.* are empty. Previously the dotnet build step still passed /p:Version=, /p:FileVersion=, /p:InformationalVersion= with empty values. Wrap each /p:* arg in a guard that omits the property when the corresponding step output is empty.
1 parent 65da5a2 commit 845ef32

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/validate-and-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ jobs:
142142
dotnet build CosmosDBShell.sln
143143
--configuration $env:BUILD_CONFIGURATION
144144
--no-restore
145-
/p:Version=${{ steps.version.outputs.assembly_version }}
146-
/p:FileVersion=${{ steps.version.outputs.file_version }}
147-
/p:InformationalVersion=${{ steps.version.outputs.informational_version }}
145+
$(if ('${{ steps.version.outputs.assembly_version }}') { "/p:Version=${{ steps.version.outputs.assembly_version }}" })
146+
$(if ('${{ steps.version.outputs.file_version }}') { "/p:FileVersion=${{ steps.version.outputs.file_version }}" })
147+
$(if ('${{ steps.version.outputs.informational_version }}') { "/p:InformationalVersion=${{ steps.version.outputs.informational_version }}" })
148148
shell: pwsh
149149

150150
- name: Test solution

0 commit comments

Comments
 (0)