Skip to content

Commit 45b241a

Browse files
committed
Clean environment variables and usage
1 parent 0c00a04 commit 45b241a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/master.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ env:
3535
BUILD_CONFIGURATION: Release
3636
FEEDZ_URI: https://f.feedz.io/forevolve/operationresults/nuget/index.json
3737
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
38-
IS_REPO_DISPATCH: ${{ github.event_name == 'repository_dispatch' }}
39-
IS_WORKFLOW_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }}
40-
IS_NOT_DISPATCH: ${{ github.event_name != 'repository_dispatch' && github.event_name != 'workflow_dispatch' }}
4138

4239
jobs:
4340
build-and-test:
@@ -46,10 +43,10 @@ jobs:
4643
fail-fast: false
4744
matrix:
4845
dotnet: ['5.0.x']
46+
env:
47+
IS_NOT_DISPATCH: ${{ github.event_name != 'repository_dispatch' && github.event_name != 'workflow_dispatch' }}
4948

5049
steps:
51-
- run: echo -e "IS_REPO_DISPATCH:" ${{ env.IS_REPO_DISPATCH }} "\nIS_WORKFLOW_DISPATCH:" ${{ env.IS_WORKFLOW_DISPATCH }} "\nIS_NOT_DISPATCH:" ${{ env.IS_NOT_DISPATCH }}
52-
5350
- uses: actions/checkout@v1
5451
if: env.IS_NOT_DISPATCH
5552

@@ -74,6 +71,9 @@ jobs:
7471
fail-fast: true
7572
matrix:
7673
dotnet: ['5.0.x']
74+
env:
75+
PUSH_TO_FEEDZ: github.event_name == 'pull_request' || (github.event_name == 'repository_dispatch' && github.event.client_payload.feedz == true) || (github.event_name == 'workflow_dispatch' && github.event.inputs.deployToFeedz == 'true')
76+
PUSH_TO_NUGET: github.event_name == 'push' || (github.event_name == 'repository_dispatch' && github.event.client_payload.nuget == true) || (github.event_name == 'workflow_dispatch' && github.event.inputs.deployToNuget == 'true')
7777

7878
steps:
7979
- uses: actions/checkout@v1
@@ -94,8 +94,8 @@ jobs:
9494

9595
- name: Push to feedz.io
9696
run: dotnet nuget push **/*.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s ${{ env.FEEDZ_URI }}
97-
if: github.event_name == 'pull_request' || (env.IS_REPO_DISPATCH && github.event.client_payload.feedz == true) || (env.IS_WORKFLOW_DISPATCH && github.event.inputs.deployToFeedz == 'true')
97+
if: env.PUSH_TO_FEEDZ
9898

9999
- name: Push to NuGet.org
100100
run: dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
101-
if: github.event_name == 'push' || (env.IS_REPO_DISPATCH && github.event.client_payload.nuget == true) || (env.IS_WORKFLOW_DISPATCH && github.event.inputs.deployToNuget == 'true')
101+
if: env.PUSH_TO_NUGET

0 commit comments

Comments
 (0)