`github.event.inputs.tag` is never set but `.tags` is. I changed the output text from singular to plural and changed the used input variable to the correct one
39 lines
1.3 KiB
Markdown
39 lines
1.3 KiB
Markdown
When using the `workflow_dispatch` event, you can optionally specify inputs that are passed to the workflow.
|
|
|
|
The triggered workflow receives the inputs in the `github.event.inputs` context. For more information, see "[Contexts](/actions/learn-github-actions/contexts#github-context)."
|
|
|
|
```yaml
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
logLevel:
|
|
description: 'Log level'
|
|
required: true
|
|
default: 'warning' {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
|
|
type: choice
|
|
options:
|
|
- 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: true {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
|
|
type: string
|
|
environment:
|
|
description: 'Environment to run tests against'
|
|
type: environment
|
|
required: true {% endif %}
|
|
|
|
jobs:
|
|
print-tag:
|
|
runs-on: ubuntu-latest
|
|
if: {% raw %} ${{ github.event.inputs.print_tags == 'true' }} {% endraw %}
|
|
steps:
|
|
- name: Print the input tag to STDOUT
|
|
run: echo {% raw %} The tags are ${{ github.event.inputs.tags }} {% endraw %}
|
|
```
|