File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Main
22on :
33 workflow_dispatch :
4- inputs :
5- targetBranch :
6- description : " Branch to target"
7- required : true
8- default : " develop"
94 push :
105 branches :
116 - main
149 types : [ opened, synchronize, reopened ]
1510 release :
1611 types : [ published ]
12+
13+ env :
14+ IS_MAIN : ${{ github.ref_name == 'main' }}
15+
1716jobs :
1817 unit-tests :
1918 name : Run Unit Tests
@@ -22,18 +21,14 @@ jobs:
2221
2322 validation-tests :
2423 name : Run Validation Tests
25- if : >
26- (github.event_name == 'workflow_dispatch' && github.event.inputs.targetBranch == 'main') ||
27- (github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request' && github.ref_name == 'main')
24+ if : ${{ env.IS_MAIN && github.event_name != 'pull_request' }}
2825 uses : ./.github/workflows/validation-tests.yml
2926 secrets : inherit
3027
3128 publish-nuget :
3229 name : Publish Nuget
3330 needs : [ unit-tests ]
34- if : >
35- (github.event_name == 'workflow_dispatch' && github.event.inputs.targetBranch == 'main') ||
36- (github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request' && github.ref_name == 'main')
31+ if : ${{ env.IS_MAIN && github.event_name != 'pull_request' }}
3732 uses : ./.github/workflows/publish-svs.yml
3833 secrets : inherit
3934 with :
4237 publish-nuget-beta :
4338 name : Publish Nuget Beta
4439 needs : [ unit-tests ]
45- if : >
46- (github.event_name == 'workflow_dispatch' && github.event.inputs.targetBranch != 'main') ||
47- (github.event_name != 'workflow_dispatch' && github.ref_name != 'main')
40+ if : ${{ !env.IS_MAIN }}
4841 uses : ./.github/workflows/publish-svs.yml
4942 secrets : inherit
5043 with :
You can’t perform that action at this time.
0 commit comments