-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the replacement for core.setOutput
?
#1218
Comments
I'm using this in the interim. const os = require("os")
const fs = require("fs")
function setOutput(key, value) {
// Temporary hack until core actions library catches up with github new recommendations
const output = process.env['GITHUB_OUTPUT']
fs.appendFileSync(output, `${key}=${value}${os.EOL}`)
} |
It seems fixed in version 1.10.0 #1178 |
Just noticed the same warnings which point to recommendations from Current notification message:
The current function logic is in export function setOutput(name: string, value: any): void {
const filePath = process.env['GITHUB_OUTPUT'] || ''
if (filePath) {
return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value))
}
process.stdout.write(os.EOL)
issueCommand('set-output', {name}, toCommandValue(value))
} |
Is there any updates on this? I've updated |
Also still seeing this issue with the latest release. |
#1178 was merged on September 29 in b00a9fd033f4b30f2355acd212f531ecbbb9b38f The @actions/core@1.1.0 tag was created on September 5, which is prior. It seems there hasn't been a release with the |
This is definitively fixed in npm info @actions/core
And then you can dig into the package contents and find: function setOutput(name, value) {
const filePath = process.env['GITHUB_OUTPUT'] || '';
if (filePath) {
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
}
process.stdout.write(os.EOL);
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
} So v1 of |
In version 1.10.0 of `@actions/core` they have fixed the warning we are getting for set-output in our github actions. As per per this PR actions/toolkit#1178 And as discussed here actions/toolkit#1218
note that #1336 should provide a fix for it |
its not working for me, already upgrade my action/core to latest, warning still shown |
@paolorevillosa this was fixed in
Can you verify that's not the case please? Is your action public? |
I am using actions/core version 1.10.1 and I am still getting the deprecation warning. You can see the code here |
I was able to fix it in a github workflow step as below as suggested in docs
|
Describe the bug
I am receiving warnings on my actions for using the
setOutput
method on thecore
object. The documentation suggests this method used to pass variables between actions is deprecated. Is there a replacement coming for this behavior? If not do you have a migration guide?The text was updated successfully, but these errors were encountered: