Skip to content

Commit cd72c88

Browse files
authored
[CI] Add workflow_dispatch to publish-release.yml
1 parent aecba3d commit cd72c88

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/publish-release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
name: Upload and Publish Python Package
2-
32
on:
43
workflow_run:
54
workflows: ["run_unit_tests"]
65
types:
76
- completed
7+
workflow_dispatch:
88

99
jobs:
1010
check-tag:
1111
name: Check if commit is a tag
12-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
12+
if: >
13+
github.event_name == 'workflow_dispatch' ||
14+
github.event.workflow_run.conclusion == 'success'
1315
runs-on: ubuntu-latest
1416
outputs:
1517
is_tagged: ${{ steps.check-tag.outputs.is_tagged }}
1618
tag_name: ${{ steps.check-tag.outputs.tag_name }}
1719
is_prerelease: ${{ steps.check-tag.outputs.is_prerelease }}
1820
steps:
19-
- name: Fetch repo
21+
- name: Checkout full history
2022
uses: actions/checkout@v4
2123
with:
2224
fetch-depth: 0
2325

24-
- name: Check if commit was a tag and detect prerelease
26+
- name: Determine tagged commit and pre-release
2527
id: check-tag
2628
run: |
27-
TAG=$(git tag --points-at ${{ github.event.workflow_run.head_sha }} | head -n 1)
29+
TAG=$(git tag --points-at HEAD | head -n 1)
2830
echo "Found tag: $TAG"
2931
if [[ "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
3032
echo "is_tagged=true" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)