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

Migrate away from the save-state command to Environment Files #461

Closed
sschuberth opened this issue Oct 12, 2022 · 5 comments · Fixed by duckduckgo/Android#2422 or #477
Closed

Migrate away from the save-state command to Environment Files #461

sschuberth opened this issue Oct 12, 2022 · 5 comments · Fixed by duckduckgo/Android#2422 or #477
Milestone

Comments

@sschuberth
Copy link

I'm getting warnings that

The `save-state` 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/

This is just a heads-up to plan for the migration.

@sschuberth
Copy link
Author

@tbroyer
Copy link

tbroyer commented Oct 12, 2022

If I read that right, this should be solved by #455

sgammon added a commit to elide-tools/gradle-build-action that referenced this issue Oct 15, 2022
This changeset upgrades `@actions/core` to `1.10.1`, along with
`@actions/github` and `@actions/cache`. The codebase-enclosed
patch for `@actions/cache` applied successfully and was also
updated.

Fixes and closes gradle#461.
sgammon added a commit to elide-tools/gradle-build-action that referenced this issue Oct 15, 2022
This changeset upgrades `@actions/core` to `1.10.1`, along with
`@actions/github` and `@actions/cache`. The codebase-enclosed
patch for `@actions/cache` applied successfully and was also
updated.

Fixes and closes gradle#461.
@TWiStErRob
Copy link

TWiStErRob commented Oct 18, 2022

@tbroyer looking at https://github.com/actions/checkout/pull/962/files and https://github.com/actions/checkout/pull/939/files there might be more to do. Although in https://github.com/actions/setup-java/pull/390/files they didn't need to do anything else.

I think for https://github.com/oss-review-toolkit/ort/actions/runs/3233029610/jobs/5294381795#step:4:2131 there are extra steps to replace:

println("::set-output name=build-scan-url::${buildScan.buildScanUri}")

Action and workflow authors who are using save-state or set-output via stdout should update to use the new environment files. -- https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

I think it'll be something like this:

File(System.getEnv("GITHUB_OUTPUT")) << "build-scan-url=${buildScan.buildScanUri}\n"

(unsure if \n before/after is needed, echo does add after, so I think it's being a good citizen.)

Also there are similar usages in examples: .github/workflow-samples

bigdaz added a commit that referenced this issue Oct 20, 2022
bigdaz added a commit that referenced this issue Oct 20, 2022
- Use GITHUB_OUTPUT file in init script
- Write to a marker file in configuratiion-cache tests

Fixes #461
bigdaz added a commit that referenced this issue Oct 20, 2022
- Use GITHUB_OUTPUT file in init script
- Write to a marker file in configuratiion-cache tests

Fixes #461
@bigdaz bigdaz added this to the v2.3.3 milestone Oct 22, 2022
@bigdaz
Copy link
Member

bigdaz commented Oct 22, 2022

The fix has been released as v2.3.3 (v2). Please let me know if these deprecation warnings persist.

@TWiStErRob
Copy link

Confirmed clean Gradle builds in detekt/detekt#5467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants