File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 44 push :
55 tags :
66 - " v*"
7+ workflow_dispatch :
8+ inputs :
9+ reason :
10+ description : Why did you trigger the pipeline?
11+ required : False
12+ default : Check if it runs again due to external changes
713
814env :
915 PY_COLORS : 1
1723 - uses : actions/checkout@v3
1824 with :
1925 fetch-depth : 0
20- - name : Fail if not on 'master' branch
21- 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' $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'
2238 run : exit -1
2339 - name : Set up Python 3.8
2440 uses : actions/setup-python@v4
You can’t perform that action at this time.
0 commit comments