Skip to content
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

Stop using deprecated set-output #15

Closed
atoomic opened this issue Oct 31, 2022 · 8 comments
Closed

Stop using deprecated set-output #15

atoomic opened this issue Oct 31, 2022 · 8 comments

Comments

@atoomic
Copy link
Member

atoomic commented Oct 31, 2022

Need to adjust set-output usage, this is currently throwing that warning

The set-output command is deprecated and will be disabled soon.
Please upgrade to using Environment Files.
For more information see:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

@atoomic
Copy link
Member Author

atoomic commented Oct 31, 2022

Let's try to update the full upstream stack via #16

@atoomic
Copy link
Member Author

atoomic commented Oct 31, 2022

This is already reported upstream and tracked via actions/toolkit#1218

Temporary Suggestion:

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}`)
}

Probably better to wait for a fix from upstream

@JJ
Copy link

JJ commented Jan 4, 2023

This should be fixed already upstream, right?

@atoomic
Copy link
Member Author

atoomic commented Feb 20, 2023

this is not fixed upstream view https://github.com/actions/toolkit/blob/main/packages/core/src/core.ts#L199

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))
}

@atoomic
Copy link
Member Author

atoomic commented Feb 20, 2023

there is a case to fix it we should track actions/toolkit#1336

@rafork
Copy link

rafork commented May 13, 2023

This is getting urgent. Two weeks left (maybe?):

From https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Starting today [October 11, 2022] runner version 2.298.2 will begin to warn you if you use the save-state or set-output commands via stdout. We are monitoring telemetry for the usage of these commands and plan to fully disable them on 31st May 2023. Starting 1st June 2023 workflows using save-state or set-output commands via stdout will fail with an error.

@atoomic
Copy link
Member Author

atoomic commented Jan 2, 2024

probably consider using console.log instead

atoomic added a commit that referenced this issue Jan 2, 2024
@atoomic
Copy link
Member Author

atoomic commented Jan 2, 2024

this should now be fixed by 798bfcd

@atoomic atoomic closed this as completed Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants