Skip to content

Commit 0edfe27

Browse files
committed
Update CI workflow branch conditions
Replaced environment variable conditions with explicit branch checks for job execution in the CI workflow. This ensures jobs run only on 'main' or release branches, improving reliability and clarity.
1 parent 08df524 commit 0edfe27

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/ci-build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ jobs:
9191
path: |
9292
./*.nupkg
9393
94-
# Sign the packages for release
94+
# Sign the packages for release.
95+
# Note: here and below we're explicitly repeating the conditions, rather than using 'env.'.
96+
# Doing so doesn't seem to work for conditions of jobs themselves, only for individual steps.
9597
sign:
9698
needs: [build-and-test]
97-
if: ${{ env.IS_MAIN == 'true' || env.IS_RELEASE == 'true' }}
99+
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/') }}
98100
runs-on: windows-latest
99101
permissions:
100102
id-token: write # Required for requesting the JWT
@@ -155,7 +157,7 @@ jobs:
155157
156158
# Push official packages to NuGet
157159
release:
158-
if: ${{ env.IS_RELEASE == 'true' }}
160+
if: ${{ startsWith(github.ref, 'refs/heads/rel/') }}
159161
needs: [sign]
160162
environment: nuget-release-gate # This gates this job until manually approved
161163
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)