This article provides a comprehensive guide on managing environment variables within GitHub actions. It discusses two methods: exporting variables using the "export" keyword and defining outputs using the "outputs" keyword. The gu
To export an environment variable from a GitHub action, you can use the export
keyword. The syntax for exporting a variable is as follows:
export variable_name=variable_value
For example, the following action exports the MY_VARIABLE
environment variable with the value my-value
:
steps: - export MY_VARIABLE=my-value
To make a variable available outside of a GitHub action, you can use the outputs
keyword. The syntax for defining outputs is as follows:
outputs: variable_name: value: variable_value
For example, the following action defines the MY_VARIABLE
output with the value my-value
:
outputs: MY_VARIABLE: value: my-value
The syntax for exporting a variable in GitHub actions is as follows:
export variable_name=variable_value
Das obige ist der detaillierte Inhalt vonSo exportieren Sie Variablen in Github-Aktionen. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!