Skip to content

Commit 375d369

Browse files
committed
feat: simplify, we dont need the input
1 parent 448483f commit 375d369

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

.github/workflows/main.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: Main
22
on:
33
workflow_dispatch:
4-
inputs:
5-
targetBranch:
6-
description: "Branch to target"
7-
required: true
8-
default: "develop"
94
push:
105
branches:
116
- main
@@ -14,6 +9,10 @@ on:
149
types: [ opened, synchronize, reopened ]
1510
release:
1611
types: [ published ]
12+
13+
env:
14+
IS_MAIN: ${{ github.ref_name == 'main' }}
15+
1716
jobs:
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:
@@ -42,9 +37,7 @@ jobs:
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:

0 commit comments

Comments
 (0)