File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1111 schedule :
1212 # Run the second day of every month.
1313 - cron : " 12 3 2 * *"
14+ push :
15+ tags :
16+ - ' *'
1417
1518env :
1619 # Change these for your project's URLs
2225 check-branch :
2326 runs-on : ubuntu-latest
2427 steps :
25- - name : Check if the branch is main
28+ - name : Check if the branch is main for workflow dispatches
2629 run : |
27- if [ "${{ github.ref }}" != "refs/heads/main" ]; then
30+ if ["${{ github.event_name }}" == "workflow_dispatch"] && [ "${{ github.ref }}" != "refs/heads/main" ]; then
2831 echo "This workflow can only run on the main branch. Exiting."
2932 exit 0
3033 fi
5861 fi
5962 - name : Output dev version
6063 id : output-dev-version
61- run : echo "dev_version=${{ env.suffix }}${{ env.iteration }}" >> "$GITHUB_OUTPUT"
64+ # Don't output a dev version if the push was for a tag.
65+ run : |
66+ if [ ${{ startsWith(github.ref, 'refs/tags') }} ]; then
67+ echo "dev_version=''" >> "$GITHUB_OUTPUT"
68+ else
69+ echo "dev_version=${{ env.suffix }}${{ env.iteration }}" >> "$GITHUB_OUTPUT"
70+ fi
6271
6372 build :
6473 name : Build distribution 📦
You can’t perform that action at this time.
0 commit comments