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

Fix bugs related to go_version_file input #392

Merged
merged 4 commits into from Aug 15, 2022

Conversation

upamune
Copy link
Member

@upamune upamune commented Aug 14, 2022

WHAT

  1. Added go_version_file to action.yml to avoid a warning
  2. Remove the default value of go_version from action.yml and add the deafult Go version to the code.

WHY

  1. To avoid a below warning

Warning: Unexpected input(s) 'go_version_file', valid inputs are ['github_token', 'golangci_lint_flags', 'tool_name', 'level', 'reporter', 'filter_mode', 'fail_on_error', 'reviewdog_flags', 'workdir', 'reviewdog_version', 'golangci_lint_version', 'go_version', 'cache']

  1. If the go_version default value is set in action.yml, the go_version_file value is never used. This is because if both are set, the go_version value takes precedence. Therefore, I've modified it to use the default version if go_version and go_version_file are not set.

@upamune upamune self-assigned this Aug 14, 2022
@upamune
Copy link
Member Author

upamune commented Aug 14, 2022

@shogo82148 Thank you for reviewing the #389. I actually tried to run it, but found problems. Therefore, I created this PR. Could you review it?

@upamune upamune changed the title Fix related to go_version_file input Fix bugs related to go_version_file input Aug 14, 2022
Comment on lines +34 to +36
await core.group("Installing Go ...", async () => {
await setupGo.run(goVersion, goVersionFile);
});
Copy link
Member Author

Choose a reason for hiding this comment

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

When a user wants to use the default goVersion, the goVersion is passed as an empty string, so I removed this if block.

Copy link
Contributor

@shogo82148 shogo82148 left a comment

Choose a reason for hiding this comment

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

LGT

@shogo82148 shogo82148 merged commit 70498f2 into reviewdog:master Aug 15, 2022
@upamune
Copy link
Member Author

upamune commented Aug 15, 2022

Thank you for your quick review! I tried the following pattern on my project and confirmed that it works correctly.

  • specify only go_version
  • specify only go_version_file
  • specify both go_version and go_version_file
  • specify nothing

@upamune upamune deleted the fix-go-version-file-path branch August 15, 2022 01:02
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