exportVariable function
Sets env variable for this action and future actions in the job.
Implementation
void exportVariable({required String name, required Object value}) {
final convertedVal = toCommandValue(value);
final filePath = environmentVariables['GITHUB_ENV'] ?? '';
if (filePath.isNotEmpty) {
const delimiter = '_GitHubActionsFileCommandDelimeter_';
const separator = '\n';
final commandValue =
'$name<<$delimiter$separator$convertedVal$separator$delimiter';
issueFileCommand('ENV', commandValue);
} else {
issueCommand('set-env', {'name': name}, convertedVal);
}
updateEnvironmentVariableCache(name: name, value: convertedVal);
}