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

Support reading go version from file with setup-go-version-file #25

Merged
merged 1 commit into from Jan 6, 2023

Conversation

manicminer
Copy link
Member

@manicminer manicminer commented Nov 18, 2022

Using the go-version-file argument added in actions/setup-go#62 (comment)

Please note I have not yet tested this end-to-end, I am assuming the desired behavior will occur when setup-go-version is empty and opening this PR in case someone else wants to test it first.

If it works, I'll add a block to the README too.

@manicminer manicminer requested a review from a team as a code owner November 18, 2022 11:37
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @manicminer 👋 Thank you for raising this. I verified that actions/setup-go's JavaScript should do the "right" thing here where it will:

  • Use go-version if non-empty
  • Use go-version-file if go-version is not non-empty
  • Generate a warning if both go-version and go-version-file are non-empty, but will prefer the go-version value in that case (seems like a reasonable default)

One small wrinkle is what will happen now if both inputs to these reusable actions are now empty (since the setup-go-version input is no longer required). It should fallback to whatever setup-go's behavior is in that case, but it might not be clear that the lack of a go executable in later steps is failing because of this particular reusable action inputs issue. I think that behavior is acceptable for now and any potential improvements on how to handle this setup-go input issue should be handled upstream.

If you have the opportunity, it would be great to update the README, otherwise we can handle that post-merge when we intend to release this first thing in the new year.

Reference: https://github.com/actions/setup-go/blob/17106403fa5e2516d58cbf6bf1314893d4351d78/src/main.ts#L124-L148

@bflad bflad added this to the v2.2.0 milestone Jan 6, 2023
@bflad bflad merged commit 2349096 into hashicorp:main Jan 6, 2023
@manicminer manicminer deleted the go-version-from-file branch January 9, 2023 09:39
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.

None yet

2 participants