Skip to content

Commit 9770709

Browse files
authored
chore: remove branch filter on release workflow (#1153)
* chore: remove branch filter on release workflow * ensure non-pre releases target main
1 parent 2bd3528 commit 9770709

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,26 @@ on:
1919
- premajor
2020
pull_request:
2121
types: [closed]
22-
branches: [main]
2322

2423
jobs:
2524
release:
26-
if: ${{github.event_name != 'pull_request' || (github.event.pull_request.merged && github.event.pull_request.user.login == 'optic-release-automation[bot]')}}
25+
if: >-
26+
${{
27+
(
28+
startsWith(github.event.inputs.semver, 'pre') ||
29+
github.ref == format(
30+
'refs/heads/{0}',
31+
github.event.repository.default_branch
32+
)
33+
) &&
34+
(
35+
github.event_name != 'pull_request' ||
36+
(
37+
github.event.pull_request.merged &&
38+
github.event.pull_request.user.login == 'optic-release-automation[bot]'
39+
)
40+
)
41+
}}
2742
runs-on: ubuntu-latest
2843
permissions:
2944
contents: write

0 commit comments

Comments
 (0)