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

feat: make env optional, prompt when not set #23

Merged
merged 6 commits into from
Nov 14, 2023
Merged

Conversation

galargh
Copy link
Contributor

@galargh galargh commented Sep 21, 2023

This PR addresses feedback from #17. It:

  • fixed newline rendering
  • makes .env file optional (when a specific secret is not available, the tool will prompt for user input instead of quitting)

}
name := util.GetenvPrompt("GITHUB_USER_NAME")
email := util.GetenvPrompt("GITHUB_USER_EMAIL")
token := util.GetenvPromptSecret("GITHUB_TOKEN", "The token should have the following scopes: ... Please enter the token:")
Copy link
Collaborator

Choose a reason for hiding this comment

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

... is a TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeap, I didn't check what those should be exactly yet.

return fmt.Errorf("GITHUB_TOKEN not set")
}
name := util.GetenvPrompt("GITHUB_USER_NAME")
email := util.GetenvPrompt("GITHUB_USER_EMAIL")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should / could we keep the default?
Something like

> GITHUB_USER_EMAIL is not set. Please enter a value (default to "noreply+kuboreleaser@ipfs.tech")
> ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking that the default might be a bit misleading. As in, if the user is using kuboreleaser, the commits should be associated with the user. If it's CI (hopefully, in the near future), then we can make sure the env var is set. Does it make sense?

util/env.go Outdated Show resolved Hide resolved
util/env.go Outdated Show resolved Hide resolved
@Jorropo Jorropo mentioned this pull request Oct 5, 2023
@galargh galargh merged commit 16cde2b into main Nov 14, 2023
@galargh galargh deleted the address-feedback branch November 14, 2023 14:36
@galargh galargh mentioned this pull request Jan 4, 2024
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.

3 participants