Skip to content

Commit 2b97feb

Browse files
authored
SKip (#164)
1 parent 264da11 commit 2b97feb

1 file changed

Lines changed: 18 additions & 23 deletions

File tree

.github/workflows/python-release.yml

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,40 +37,29 @@ defaults:
3737
jobs:
3838
check_pr_push:
3939
runs-on: ubuntu-latest
40-
if: github.event_name == 'pull_request' && github.event.action != 'closed'
40+
if: |
41+
github.event_name == 'pull_request' && github.event.action != 'closed' ||
42+
github.event_name == 'push' && contains(fromJSON('["master", "dev", "development"]'), github.ref_name)
4143
outputs:
4244
run: ${{ steps.check.outputs.run }}
4345
steps:
4446
- name: Check if should run on PR push
4547
id: check
4648
run: |
47-
if [ "${{ env.TRIGGER_ON_PR_PUSH }}" = "true" ]; then
49+
# Always run on pushes to main branches
50+
if [ "${{ github.event_name }}" = "push" ] && [[ "${{ github.ref_name }}" =~ ^(master|dev|development)$ ]]; then
51+
echo "run=true" >> $GITHUB_OUTPUT
52+
# For PRs, check the TRIGGER_ON_PR_PUSH setting
53+
elif [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ env.TRIGGER_ON_PR_PUSH }}" = "true" ]; then
4854
echo "run=true" >> $GITHUB_OUTPUT
4955
else
5056
echo "run=false" >> $GITHUB_OUTPUT
5157
fi
5258
5359
54-
debug_context:
55-
runs-on: ubuntu-latest
56-
if: always()
57-
steps:
58-
- name: Debug GitHub Context
59-
run: |
60-
echo "Event: ${{ github.event_name }}"
61-
echo "Action: ${{ github.event.action }}"
62-
echo "Ref: ${{ github.ref }}"
63-
echo "Ref Name: ${{ github.ref_name }}"
64-
echo "Base Ref: ${{ github.base_ref }}"
65-
echo "Head Ref: ${{ github.head_ref }}"
66-
echo "PR Merged: ${{ github.event.pull_request.merged }}"
67-
6860
build_wheels_pecos_rslib:
6961
needs: check_pr_push
70-
if: |
71-
always() &&
72-
(needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' ||
73-
needs.check_pr_push.result == 'skipped')
62+
if: needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true'
7463
runs-on: ${{ matrix.os }}
7564
strategy:
7665
fail-fast: false
@@ -149,7 +138,9 @@ jobs:
149138

150139
test_abi3_wheels:
151140
needs: build_wheels_pecos_rslib
152-
if: needs.build_wheels_pecos_rslib.result == 'success'
141+
if: |
142+
always() &&
143+
needs.build_wheels_pecos_rslib.result == 'success'
153144
runs-on: ${{ matrix.platform.runner }}
154145
strategy:
155146
fail-fast: false
@@ -194,7 +185,9 @@ jobs:
194185
195186
build_sdist_quantum_pecos:
196187
needs: build_wheels_pecos_rslib
197-
if: needs.build_wheels_pecos_rslib.result == 'success'
188+
if: |
189+
always() &&
190+
needs.build_wheels_pecos_rslib.result == 'success'
198191
runs-on: ubuntu-latest
199192
steps:
200193
- uses: actions/checkout@v4
@@ -244,7 +237,9 @@ jobs:
244237

245238
build_wheels_quantum_pecos:
246239
needs: build_wheels_pecos_rslib
247-
if: needs.build_wheels_pecos_rslib.result == 'success'
240+
if: |
241+
always() &&
242+
needs.build_wheels_pecos_rslib.result == 'success'
248243
runs-on: ubuntu-latest
249244

250245
steps:

0 commit comments

Comments
 (0)