Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To retrieve the inputs of the composite GitHub action within the script files that are invoked by the composite action, you can use the inputs object provided by the GitHub Actions context. The inputs object contains the value of all declared inputs for the action.

You can access the inputs object in your script file by referencing the environment variable INPUT_<INPUT_NAME> (where <INPUT_NAME> is the name of the input). For example, to retrieve the value of an input named my-input in a JavaScript script file, you can use the following code:

const myInput = process.env.INPUT_MY_INPUT;
console.log(`The value of my input is: ${myInput}`);

Note that the INPUT_<INPUT_NAME> environment variable may contain a string value, so you may need to parse it or convert it to the appropriate data type.