actions / upload-artifact

MIT License
3.03k stars 686 forks source link

[bug] upload-artifact@v3 generates build warning "`The set-output` command is deprecated ..." #439

Closed EricZinda closed 7 months ago

EricZinda commented 10 months ago

What happened?

I'm using upload-artifact@v3 to upload a file. Here's the workflow section:

      - uses: actions/upload-artifact@v3
        with:
          name: Fixes for broken links To Wiki pages
          path: main/latestsrc/FixesForBrokenLinksToWikiPages.json
          if-no-files-found: ignore 

I get the following warning from the github runner:

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/

It looks like it might be coming from this code in upload-artifact?

/**
 * Sets the value of an output.
 *
 * @param     name     name of the output to set
 * @param     value    value to store. Non-string values will be converted to a string via JSON.stringify
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
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));
}
exports.setOutput = setOutput;

What did you expect to happen?

That there wouldn't be this build warning

How can we reproduce it?

My workflow seems straightforward and is public here: https://github.com/delph-in/docs/blob/main/.github/workflows/BuildDocs.yml

All 4 uses of upload-artifact@v3 generate the warning.

Anything else we need to know?

No response

What version of the action are you using?

v3

What are your runner environments?

linux

Are you on GitHub Enterprise Server? If so, what version?

No response

konradpabjan commented 7 months ago

This was fixed a while back ago so closing out

Looking at some example runs in your public repo you can see they are no longer there!

Image

(side note, we did just drop artifacts v4 today so recommend moving over https://github.blog/changelog/2023-12-14-github-actions-artifacts-v4-is-now-generally-available/)