Skip to content

Commit 487a1f5

Browse files
authored
Add input option for NuGet publishing in workflow
1 parent b722550 commit 487a1f5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ on:
33
push:
44
pull_request:
55
workflow_dispatch:
6+
inputs:
7+
runPublish:
8+
description: 'Publish Nuget ?'
9+
required: true
10+
default: 'false'
11+
type: choice
12+
options:
13+
- 'true'
14+
- 'false'
615

716
jobs:
817
build:
@@ -133,7 +142,7 @@ jobs:
133142
publish-nuget:
134143
runs-on: ubuntu-latest
135144
needs: build
136-
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
145+
if: github.event.inputs.runPublish == 'true' && github.ref_name == github.event.repository.default_branch
137146
environment:
138147
name: Publish
139148
url: https://www.nuget.org/packages/TestStack.BDDfy/
@@ -206,4 +215,4 @@ jobs:
206215
--notes-file release-notes.md \
207216
--generate-notes
208217
env:
209-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)