MCPcopy Index your code
hub / github.com/actions/setup-node / printEnvDetailsAndSetOutput

Function printEnvDetailsAndSetOutput

src/util.ts:75–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75export async function printEnvDetailsAndSetOutput() {
76 core.startGroup('Environment details');
77 const promises = ['node', 'npm', 'yarn'].map(async tool => {
78 const pathTool = await io.which(tool, false);
79 const output = pathTool ? await getToolVersion(tool, ['--version']) : '';
80
81 return {tool, output};
82 });
83
84 const tools = await Promise.all(promises);
85 tools.forEach(({tool, output}) => {
86 if (tool === 'node') {
87 core.setOutput(`${tool}-version`, output);
88 }
89 core.info(`${tool}: ${output}`);
90 });
91
92 core.endGroup();
93}
94
95async function getToolVersion(tool: string, options: string[]) {
96 try {

Callers 1

runFunction · 0.90

Calls 1

getToolVersionFunction · 0.85

Tested by

no test coverage detected