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 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 join this conversation on GitHub. Already have an account? Sign in to comment
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