From c1d3b963268f6b92fb754091deb2b1fa8353944a Mon Sep 17 00:00:00 2001 From: Nicholas Hebert Date: Tue, 30 Nov 2021 10:21:48 -0400 Subject: [PATCH 1/2] Provide workflow_dispatch variable usage example --- .../workflow-syntax-for-github-actions.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/content/actions/learn-github-actions/workflow-syntax-for-github-actions.md b/content/actions/learn-github-actions/workflow-syntax-for-github-actions.md index 1e65fc3ac3..8486bb805a 100644 --- a/content/actions/learn-github-actions/workflow-syntax-for-github-actions.md +++ b/content/actions/learn-github-actions/workflow-syntax-for-github-actions.md @@ -295,6 +295,9 @@ A boolean specifying whether the secret must be supplied. 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)." + +### Example ```yaml on: workflow_dispatch: @@ -316,9 +319,16 @@ on: description: 'Environment to run tests against' type: environment required: true {% endif %} -``` + +jobs: + print-tag: + runs-on: ubuntu-latest -The triggered workflow receives the inputs in the `github.event.inputs` context. For more information, see "[Contexts](/actions/learn-github-actions/contexts#github-context)." + steps: + - name: Print the input tag to STDOUT + run: echo The tag is ${{ github.event.inputs.tag }} +``` +{% endraw %} ## `on.schedule` From 96d7e02c2d07b2ec398d877a25f790a155c56199 Mon Sep 17 00:00:00 2001 From: Nicholas Hebert Date: Tue, 30 Nov 2021 10:51:37 -0400 Subject: [PATCH 2/2] Add missing raw element --- .../learn-github-actions/workflow-syntax-for-github-actions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/actions/learn-github-actions/workflow-syntax-for-github-actions.md b/content/actions/learn-github-actions/workflow-syntax-for-github-actions.md index 8486bb805a..9741e69151 100644 --- a/content/actions/learn-github-actions/workflow-syntax-for-github-actions.md +++ b/content/actions/learn-github-actions/workflow-syntax-for-github-actions.md @@ -298,6 +298,7 @@ When using the `workflow_dispatch` event, you can optionally specify inputs that The triggered workflow receives the inputs in the `github.event.inputs` context. For more information, see "[Contexts](/actions/learn-github-actions/contexts#github-context)." ### Example +{% raw %} ```yaml on: workflow_dispatch: