I'm working on a GitHub Actions workflow using Node.js, and I need to set an output value to be used in subsequent steps. I am getting deprecated warning for for the line.
process.stdout.write(`::set-output name=my-key::'${value}'`);
Action.yml:
name: Test New Output
description: 'Task to test new output'
runs:
using: 'node16'
main: 'test-output.js'
Full node.js is below
const fs = require('fs');
async function run() {
try {
// Calculate the value for 'blocks'
const blocks = "some value";
process.stdout.write(`::set-output name=my-key::'${blocks}'`);
} catch (error) {
console.error(error);
process.exit(1);
}
}
run();
Can anybody suggest what is the alternative for this deprecated usage.