Optional outputs use the same parameters as outputs. Required A string description of the output parameter.
The must start with a letter or _ and contain only alphanumeric characters, -, or _.
The must be a unique identifier within the outputs object. The value of is a map of the output's metadata. Required A string identifier to associate with the output. For more information on setting outputs in an action, see " Workflow commands for GitHub Actions." Example outputs: sum: # id of the output description: 'The sum of the inputs' outputs. If you don't declare an output in your action metadata file, you can still set outputs and use them in a workflow. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input. Actions that run later in a workflow can use the output data set in previously run actions. Optional Output parameters allow you to declare data that an action sets. You can use this warning to notify users that the input is deprecated and mention any alternatives. Optional If the input parameter is used, this string is logged as a warning message. The default value is used when an input parameter isn't specified in a workflow file. Optional A string representing the default value. Set to true when the parameter is required. Required A boolean to indicate whether the action requires the input parameter. Required A string description of the input parameter. The must be a unique identifier within the inputs object. The value of is a map of the input's metadata. Required A string identifier to associate with the input.
#Action strings manual code
For more information about the action metadata file for Docker container actions, see " Creating a Docker container action."įor 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. To access the environment variable in a Docker container action, you must pass the input using the args keyword in the action metadata file. If the conversion doesn't occur, you can change these inputs manually. If the action is written using a composite, then it will not automatically get INPUT_. 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, GitHub creates an environment variable for the input with the name INPUT_. For more information about the with syntax, see " Workflow syntax for GitHub Actions." inputs: numOctocats: description: 'Number of Octocats' required: false default: '1' octocatEyeColor: description: 'Eye color of the Octocats' required: true Workflow files that use this action must use the with keyword to set an input value for octocatEyeColor. The octocatEyeColor input is required and has no default value. The numOctocats input is not required and will default to a value of '1'. This example configures two inputs: numOctocats and octocatEyeColor. We recommended using lowercase input ids. Input ids with uppercase letters are converted to lowercase during runtime. GitHub stores input parameters as environment variables. Optional Input parameters allow you to specify data that the action expects to use during runtime. Required A short description of the action. Optional The name of the action's author. GitHub displays the name in the Actions tab to help visually identify actions in each job. If you're new to YAML, you can read " Learn YAML in five minutes." name The data in the metadata file defines the inputs, outputs and main entrypoint for your action.Īction metadata files use YAML syntax. The metadata filename must be either action.yml or action.yaml. Docker and JavaScript actions require a metadata file.