Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide example of boolean input usage #15349

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions content/actions/learn-github-actions/contexts.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,14 @@ on:
deploy_target:
required: true
type: string
perform_deploy:
required: true
type: boolean

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ inputs.perform_deploy == 'true' }}
steps:
- name: Deploy build to target
run: deploy --build ${{ inputs.build_id }} --target ${{ inputs.deploy_target }}
Expand Down
11 changes: 8 additions & 3 deletions data/reusables/github-actions/workflow-dispatch-inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ on:
- info
- warning
- debug {% endif %}
print_tags:
description: 'True to print to STDOUT'
required: true {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
type: boolean {% endif %}
tags:
description: 'Test scenario tags'
required: false {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
type: boolean
required: true {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
type: string
environment:
description: 'Environment to run tests against'
type: environment
Expand All @@ -30,5 +34,6 @@ jobs:

steps:
- name: Print the input tag to STDOUT
run: echo {% raw %} The tag is ${{ github.event.inputs.tag }} {% endraw %}
if: {% raw %} ${{ github.event.inputs.tags == 'true' }} {% endraw %}
run: echo {% raw %} The tag is ${{ github.event.inputs.tags }} {% endraw %}
```