question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning in workflow about set-output

See original GitHub issue

So when I use “::set-output”: Screen Shot 2022-10-26 at 12 20 55 pm

I have this 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/

I set my “output” in first job to be used in second job of my workflow: Screen Shot 2022-10-26 at 12 21 43 pm

I get the “VERSION” output: Screen Shot 2022-10-26 at 12 21 32 pm

Then after I updated my echo command to this: Screen Shot 2022-10-26 at 12 21 05 pm I don’t have 'Version" output: Screen Shot 2022-10-26 at 12 21 14 pm

So @jamesottaway @phishy can you please help me check which part is wrong?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dsamecommented, Oct 27, 2022

@christina-30 there’s no visible reason for the warning to appear, please address the issue to the team of the runner repo - they could provide more efficient support for the question.

1reaction
dsamecommented, Oct 26, 2022

@christina-30

The problem is with pwsh used as a shell for the step. To access the env. variable from it it is necessary to use $Env:VAR syntax. See here.

Thus the corrected step should look like:

      - name: set output via env. files
        id: someId
        shell: pwsh
        run: |
          echo "VERSION2=V2" >> $Env:GITHUB_OUTPUT

Sample build.

Please confirm i understood your problem right and it is solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning in workflow about set-output · Issue #334 - GitHub
Description: Warning: The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files.
Read more >
How to Fix the set-output GitHub Actions Deprecation Warning
If you have a GitHub Actions workflow that sets an output using echo ::set-output key=value , you have started to see an unhelpful...
Read more >
Deprecating save-state and set-output commands
Starting 1st June 2023 workflows using save-state or set-output commands via stdout will fail with an error. Patching your actions and workflows.
Read more >
How to Patch the Deprecated set-output in GitHub Workflows ...
Within the last week or so, I started noticing deprecation warnings in the logs of my GitHub Actions workflow runs.
Read more >
Github Actions: set-output does not seem to work
output1 is defined as that job's steps.step1.outputs.test . You can see a (very) minimal example of this here, with its corresponding workflow ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found