Skip to content

Commit 1c7200c

Browse files
authored
Merge pull request github#16028 from tevans-submittable/workflow-boolean-input-example
Workflow boolean input example
2 parents 94005b7 + 6ce27f4 commit 1c7200c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

content/actions/learn-github-actions/contexts.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,14 @@ on:
767767
deploy_target:
768768
required: true
769769
type: string
770+
perform_deploy:
771+
required: true
772+
type: boolean
770773
771774
jobs:
772775
deploy:
773776
runs-on: ubuntu-latest
777+
if: ${{ inputs.perform_deploy == 'true' }}
774778
steps:
775779
- name: Deploy build to target
776780
run: deploy --build ${{ inputs.build_id }} --target ${{ inputs.deploy_target }}

data/reusables/actions/workflow-dispatch-inputs.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ on:
1515
- info
1616
- warning
1717
- debug {% endif %}
18+
print_tags:
19+
description: 'True to print to STDOUT'
20+
required: true {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
21+
type: boolean {% endif %}
1822
tags:
1923
description: 'Test scenario tags'
20-
required: false {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
21-
type: boolean
24+
required: true {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
25+
type: string
2226
environment:
2327
description: 'Environment to run tests against'
2428
type: environment
@@ -27,7 +31,7 @@ on:
2731
jobs:
2832
print-tag:
2933
runs-on: ubuntu-latest
30-
34+
if: {% raw %} ${{ github.event.inputs.print_tags == 'true' }} {% endraw %}
3135
steps:
3236
- name: Print the input tag to STDOUT
3337
run: echo {% raw %} The tag is ${{ github.event.inputs.tag }} {% endraw %}

0 commit comments

Comments
 (0)