Skip to content

Commit 0b25acb

Browse files
authored
Fix workflow conditions. (#2203)
1 parent 88f3672 commit 0b25acb

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/binaries.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
pull_request:
77

88
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}
9+
group:
10+
${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha ||
11+
github.ref }}-{{ github.event_name }}
1012
cancel-in-progress: true
1113

1214
defaults:
@@ -19,7 +21,6 @@ permissions:
1921
attestations: write
2022

2123
jobs:
22-
2324
build:
2425
strategy:
2526
fail-fast: false
@@ -42,7 +43,9 @@ jobs:
4243
binary-name: ${{ matrix.crate.binary }}
4344

4445
build-macos:
45-
if: github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')))
46+
if:
47+
github.event_name == 'release' || github.ref == 'refs/heads/main' ||
48+
startsWith(github.head_ref, 'release/')
4649
strategy:
4750
fail-fast: false
4851
matrix:
@@ -64,7 +67,9 @@ jobs:
6467
binary-name: ${{ matrix.crate.binary }}
6568

6669
build-windows:
67-
if: github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')))
70+
if:
71+
github.event_name == 'release' || github.ref == 'refs/heads/main' ||
72+
startsWith(github.head_ref, 'release/')
6873
strategy:
6974
fail-fast: false
7075
matrix:

.github/workflows/rust.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ jobs:
8585
rust-version: ${{ matrix.rust }}
8686

8787
build-and-test-macos:
88-
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/'))
88+
if:
89+
github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'release/')
8990
strategy:
9091
fail-fast: false
9192
matrix:
@@ -104,7 +105,8 @@ jobs:
104105
rust-version: ${{ matrix.rust }}
105106

106107
build-and-test-windows:
107-
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/'))
108+
if:
109+
github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'release/')
108110
strategy:
109111
fail-fast: false
110112
matrix:

0 commit comments

Comments
 (0)