@@ -346,11 +346,11 @@ jobs:
346
346
crate: cargo-edit
347
347
bin: cargo-set-version
348
348
- name: Update version if PR against main branch
349
- if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/ main' }}
349
+ if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base. ref == 'main' }}
350
350
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
351
351
- name: Update version if PR against non-main branch
352
352
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
353
- if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
353
+ if: ${{ github.event_name == 'pull_request' && startsWith( github.event.pull_request.base. ref, 'release-') }}
354
354
env:
355
355
PR_NUMBER: ${{ github.event.pull_request.number }}
356
356
run: |
@@ -421,11 +421,11 @@ jobs:
421
421
crate: cargo-edit
422
422
bin: cargo-set-version
423
423
- name: Update version if PR against main branch
424
- if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/ main' }}
424
+ if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base. ref == 'main' }}
425
425
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
426
426
- name: Update version if PR against non-main branch
427
427
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
428
- if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
428
+ if: ${{ github.event_name == 'pull_request' && startsWith( github.event.pull_request.base. ref, 'release-') }}
429
429
env:
430
430
PR_NUMBER: ${{ github.event.pull_request.number }}
431
431
run: |
0 commit comments