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

Replace set-output with Environment Files in GitHub Actions workflow #1808

Closed
sgibson91 opened this issue Oct 21, 2022 · 6 comments · Fixed by #1865
Closed

Replace set-output with Environment Files in GitHub Actions workflow #1808

sgibson91 opened this issue Oct 21, 2022 · 6 comments · Fixed by #1865
Assignees

Comments

@sgibson91
Copy link
Member

Context

On a recent CI/CD run, this warning was triggered:

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/

We use set-output a lot to allow for sharing of variables between steps/jobs throughout various workflows. We should update to the proposed Environment Files workflow before this feature is disabled.

Proposal

No response

Updates and actions

No response

@choldgraf
Copy link
Member

choldgraf commented Oct 21, 2022

Relevant info from the post:

We are monitoring telemetry for the usage of these commands and plan to fully disable them on 31st May 2023

And a quick highlight of how this works, since I do this in a few other projects and looked it up:

A workflow using save-state or set-output like the following

- name: Save state
  run: echo "::save-state name={name}::{value}"

- name: Set output
  run: echo "::set-output name={name}::{value}"

should be updated to write to the new GITHUB_STATE and GITHUB_OUTPUT environment files:

- name: Save state
  run: echo "{name}={value}" >> $GITHUB_STATE

- name: Set output
  run: echo "{name}={value}" >> $GITHUB_OUTPUT

@damianavila damianavila moved this to Needs Shaping / Refinement in DEPRECATED Engineering and Product Backlog Oct 21, 2022
@sgibson91
Copy link
Member Author

This Stack Overflow answer demonstrates how we can replace the following statements in Python scripts by writing to a file: https://stackoverflow.com/a/70123641

print(f"::set-output ...")

@sgibson91
Copy link
Member Author

Will be closed by:

@choldgraf
Copy link
Member

Just want to say thanks @sgibson91 for doing this because I'll likely need to reference this PR in remembering how to do this in a few other projects too haha

Repository owner moved this from In progress to Complete in DEPRECATED Engineering and Product Backlog Nov 4, 2022
Repository owner moved this from Review / QA 👀 to Done 🎉 in Sprint Board Nov 4, 2022
@sgibson91
Copy link
Member Author

We are still seeing this error message, but I think this is due to code in the Azure/setup-kubectl action we depend on in .github/actions/deploy-setup/. Upstream issue below, no further action from us other than to consume the new release of the action when it's ready (which dependabot should tell us about...?... I might check that)

@sgibson91
Copy link
Member Author

sgibson91 commented Nov 4, 2022

Screenshot 2022-11-04 at 18 44 48

Also it seems like the nick-fields/retry action is causing it too

UMMMMMM, should probs address that critical error too? 😅 Opened #1875 to track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants