Skip to content

Commit 2da7fca

Browse files
committed
👷 [ci] Update publish workflow conditions for better release handling
- Enhance create-release job to support both workflow_dispatch and workflow_run events - Modify publish job conditions to ensure successful execution based on create-release results Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
1 parent a751db8 commit 2da7fca

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,17 @@ jobs:
156156
needs: validate
157157
if: |
158158
needs.validate.result == 'success' &&
159-
github.event_name == 'workflow_dispatch' &&
160-
(github.event.inputs.createRelease == 'true' || github.event.inputs.createRelease == '')
159+
(
160+
(
161+
github.event_name == 'workflow_dispatch' &&
162+
(github.event.inputs.createRelease == 'true' || github.event.inputs.createRelease == '')
163+
) ||
164+
(
165+
github.event_name == 'workflow_run' &&
166+
github.event.workflow_run.conclusion == 'success' &&
167+
github.event.workflow_run.event == 'workflow_dispatch'
168+
)
169+
)
161170
runs-on: ubuntu-latest
162171
steps:
163172
- name: Harden the runner (Audit all outbound calls)
@@ -180,12 +189,21 @@ jobs:
180189

181190
publish:
182191
name: Publish
183-
needs: validate
192+
needs:
193+
- validate
194+
- create-release
184195
if: |
185196
needs.validate.result == 'success' &&
186-
(github.event_name == 'workflow_dispatch' ||
187-
github.event_name == 'release' ||
188-
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success'))
197+
(needs['create-release'].result == 'success' || needs['create-release'].result == 'skipped') &&
198+
(
199+
github.event_name == 'workflow_dispatch' ||
200+
github.event_name == 'release' ||
201+
(
202+
github.event_name == 'workflow_run' &&
203+
github.event.workflow_run.conclusion == 'success' &&
204+
github.event.workflow_run.event == 'workflow_dispatch'
205+
)
206+
)
189207
runs-on: windows-latest
190208
env:
191209
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}

0 commit comments

Comments
 (0)