Skip to content

Commit 914424c

Browse files
committed
ci: update release.yaml
run prepare_publish_input job if not cancelled, run Release action on pull requests
1 parent 259a9d9 commit 914424c

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/release.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
branches:
99
- main
1010
- dev
11+
pull_request:
12+
branches:
13+
- main
14+
- dev
15+
paths-ignore:
16+
- .github/*
1117

1218
jobs:
1319
changes:
@@ -93,7 +99,10 @@ jobs:
9399
name: Semantic Release
94100
runs-on: ubuntu-latest
95101
needs: [lint]
96-
if: github.ref == 'refs/heads/main' && github.repository == '3dct/viqa' && always()
102+
if: |
103+
github.ref == 'refs/heads/main' &&
104+
github.repository == '3dct/viqa' &&
105+
github.event_name != 'pull_request' && '!cancelled()'
97106
permissions:
98107
id-token: write
99108
contents: write
@@ -126,7 +135,7 @@ jobs:
126135
if: |
127136
(needs.changes.outputs.build-changes == 'true' ||
128137
needs.changes.outputs.src-changes == 'true' ||
129-
needs.changes.outputs.ci-changes == 'true') && always()
138+
needs.changes.outputs.ci-changes == 'true') && '!cancelled()'
130139
strategy:
131140
fail-fast: false
132141
matrix:
@@ -174,7 +183,7 @@ jobs:
174183
if: |
175184
(needs.changes.outputs.build-changes == 'true' ||
176185
needs.changes.outputs.src-changes == 'true' ||
177-
needs.changes.outputs.ci-changes == 'true') && always()
186+
needs.changes.outputs.ci-changes == 'true') && '!cancelled()'
178187
steps:
179188
- name: Checkout code
180189
uses: actions/checkout@v4
@@ -335,9 +344,7 @@ jobs:
335344
prepare_publish_input:
336345
name: Check if published
337346
runs-on: ubuntu-latest
338-
if: |
339-
(needs.changes.outputs.doc-changes == 'true' ||
340-
needs.changes.outputs.docker-changes == 'true') && always()
347+
if: '!cancelled()'
341348
outputs:
342349
docs_publish: ${{ steps.check_docs_publish.outputs.publish }}
343350
image_publish: ${{ steps.check_image_publish.outputs.publish }}

0 commit comments

Comments
 (0)