From cd5599e3453f15c6056ad1b406d77e76ea38d934 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sun, 27 Jun 2021 22:50:07 -0400 Subject: [PATCH 1/2] Clarify how INPUT_ works or doesn't See actions/runner#665 --- .../metadata-syntax-for-github-actions.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/actions/creating-actions/metadata-syntax-for-github-actions.md b/content/actions/creating-actions/metadata-syntax-for-github-actions.md index ccdb06f677..dba439602a 100644 --- a/content/actions/creating-actions/metadata-syntax-for-github-actions.md +++ b/content/actions/creating-actions/metadata-syntax-for-github-actions.md @@ -56,7 +56,13 @@ inputs: required: true ``` -When you specify an input to an action in a workflow file or use a default input value, {% data variables.product.prodname_dotcom %} creates an environment variable for the input with the name `INPUT_`. The environment variable created converts input names to uppercase letters and replaces spaces with `_` characters. To access the environment variable in a Docker container action, you must pass the input using the `args` keyword in the action metadata file. For more information about the action metadata file for Docker container actions, see "[Creating a Docker container action](/articles/creating-a-docker-container-action#creating-an-action-metadata-file)." +When you specify an input in a workflow file or use a default input value, {% data variables.product.prodname_dotcom %} *sometimes* creates an environment variable for the input with the name `INPUT_`. +**Often it doesn't.** +The environment variable created converts input names to uppercase letters and replaces spaces with `_` characters. + +To access the environment variable in a *Docker container* action, you must pass the input using the `args` keyword in the action metadata file. For more information about the action metadata file for Docker container actions, see "[Creating a Docker container action](/articles/creating-a-docker-container-action#creating-an-action-metadata-file)." + +If the action is written using a [composite](/actions/creating-actions/creating-a-composite-run-steps-action), then it will not automatically get `INPUT_`. Instead, it is incumbent on the author of the action to manually reimplement this behavior themselves. For example, if a workflow defined the `numOctocats` and `octocatEyeColor` inputs, the action code could read the values of the inputs using the `INPUT_NUMOCTOCATS` and `INPUT_OCTOCATEYECOLOR` environment variables. From 52b853b682516bef036810f195829524d446ef52 Mon Sep 17 00:00:00 2001 From: Meg Bird Date: Mon, 28 Jun 2021 08:48:13 -0600 Subject: [PATCH 2/2] Update content/actions/creating-actions/metadata-syntax-for-github-actions.md --- .../metadata-syntax-for-github-actions.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/content/actions/creating-actions/metadata-syntax-for-github-actions.md b/content/actions/creating-actions/metadata-syntax-for-github-actions.md index dba439602a..4cc39d1515 100644 --- a/content/actions/creating-actions/metadata-syntax-for-github-actions.md +++ b/content/actions/creating-actions/metadata-syntax-for-github-actions.md @@ -56,13 +56,11 @@ inputs: required: true ``` -When you specify an input in a workflow file or use a default input value, {% data variables.product.prodname_dotcom %} *sometimes* creates an environment variable for the input with the name `INPUT_`. -**Often it doesn't.** -The environment variable created converts input names to uppercase letters and replaces spaces with `_` characters. +When you specify an input in a workflow file or use a default input value, {% data variables.product.prodname_dotcom %} creates an environment variable for the input with the name `INPUT_`. The environment variable created converts input names to uppercase letters and replaces spaces with `_` characters. -To access the environment variable in a *Docker container* action, you must pass the input using the `args` keyword in the action metadata file. For more information about the action metadata file for Docker container actions, see "[Creating a Docker container action](/articles/creating-a-docker-container-action#creating-an-action-metadata-file)." +If the action is written using a [composite](/actions/creating-actions/creating-a-composite-run-steps-action), then it will not automatically get `INPUT_`. If the conversion doesn't occur, you can change these inputs manually. -If the action is written using a [composite](/actions/creating-actions/creating-a-composite-run-steps-action), then it will not automatically get `INPUT_`. Instead, it is incumbent on the author of the action to manually reimplement this behavior themselves. +To access the environment variable in a Docker container action, you must pass the input using the `args` keyword in the action metadata file. For more information about the action metadata file for Docker container actions, see "[Creating a Docker container action](/articles/creating-a-docker-container-action#creating-an-action-metadata-file)." For example, if a workflow defined the `numOctocats` and `octocatEyeColor` inputs, the action code could read the values of the inputs using the `INPUT_NUMOCTOCATS` and `INPUT_OCTOCATEYECOLOR` environment variables.