File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11name : Upload and Publish Python Package
2-
32on :
43 workflow_run :
54 workflows : ["run_unit_tests"]
65 types :
76 - completed
7+ workflow_dispatch :
88
99jobs :
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
You can’t perform that action at this time.
0 commit comments