Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Replace use of set-output command with env file #477

Merged
merged 1 commit into from
Oct 20, 2022
Merged

Conversation

bigdaz
Copy link
Member

@bigdaz bigdaz commented Oct 20, 2022

Fixes #461

@@ -19,7 +19,7 @@ tasks.test {

tasks.named("test").configure {
// Echo an output value so we can detect configuration-cache usage
println("::set-output name=task_configured::yes")
File(System.getenv("GITHUB_OUTPUT")).writeText("task_configured=yes\n")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be appendText to avoid overwriting previous output.

Suggested change
File(System.getenv("GITHUB_OUTPUT")).writeText("task_configured=yes\n")
File(System.getenv("GITHUB_OUTPUT")).appendText("task_configured=yes\n")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but I'm having to replace this mechanism with a marker file.
Since the value of GITHUB_OUTPUT changes on each run, reading the environment variable itself causes the configuration-cache entry to be invalidated. This kind of defeats the purpose of this code, which is to verify that configuration caching was used!

- Use GITHUB_OUTPUT file in init script
- Write to a marker file in configuratiion-cache tests

Fixes #461
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate away from the save-state command to Environment Files
2 participants