File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 2323 - uses : actions/checkout@v3
2424 with :
2525 fetch-depth : 0
26- - name : Fail if not on 'master' branch
27- if : github.ref != 'refs/heads/master'
26+ - name : Fail if manually triggered workflow is not on 'master' branch
27+ if : github.event_name == 'workflow_dispatch' && github.ref_name != 'master'
28+ run : exit -1
29+ - name : Extract branch name from tag
30+ id : get_branch_name
31+ if : github.ref_type == 'tag'
32+ run : |
33+ export BRANCH_NAME=$(git log -1 --format='%D' $env:GITHUB_REF | | sed -e 's/.*origin\/\(.*\),.*/\1/')
34+ echo ::set-output name=branch_name::${BRANCH_NAME}
35+ shell : bash
36+ - name : Fail if tag is not on 'master' branch
37+ if : github.ref_type == 'tag' && steps.get_branch_name.outputs.branch_name != 'master'
2838 run : exit -1
2939 - name : Set up Python 3.8
3040 uses : actions/setup-python@v4
You can’t perform that action at this time.
0 commit comments