Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0943d41

Browse files
committed
Release dependent on test successg
1 parent 3be9232 commit 0943d41

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: Check Version Bump and Publish to PyPI
22

33
on:
4-
push:
4+
workflow_run:
5+
workflows: ["Python Tests"]
56
branches:
67
- main
7-
paths:
8-
- 'pyproject.toml'
8+
types:
9+
- completed
910

1011
# Required for PyPI trusted publishing
1112
permissions:
@@ -14,11 +15,14 @@ permissions:
1415

1516
jobs:
1617
check-version-and-publish:
18+
# Only proceed if the referenced workflow completed successfully
19+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1720
runs-on: ubuntu-latest
1821
steps:
1922
- uses: actions/checkout@v3
2023
with:
21-
fetch-depth: 0 # This fetches all history for comparing versions
24+
fetch-depth: 0
25+
ref: ${{ github.event.workflow_run.head_sha }}
2226

2327
- name: Set up Python
2428
uses: actions/setup-python@v4

0 commit comments

Comments
 (0)