Skip to content

Commit bcd5f8d

Browse files
committed
fixed workflow
1 parent e22fd6a commit bcd5f8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,11 @@ jobs:
345345
crate: cargo-edit
346346
bin: cargo-set-version
347347
- name: Update version if PR against main branch
348-
if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
348+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'refs/heads/main' }}
349349
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
350350
- name: Update version if PR against non-main branch
351351
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
352-
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
352+
if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'refs/heads/release-') }}
353353
env:
354354
PR_NUMBER: ${{ github.event.pull_request.number }}
355355
run: |
@@ -420,11 +420,11 @@ jobs:
420420
crate: cargo-edit
421421
bin: cargo-set-version
422422
- name: Update version if PR against main branch
423-
if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
423+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'refs/heads/main' }}
424424
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
425425
- name: Update version if PR against non-main branch
426426
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
427-
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
427+
if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'refs/heads/release-') }}
428428
env:
429429
PR_NUMBER: ${{ github.event.pull_request.number }}
430430
run: |

0 commit comments

Comments
 (0)