github-release-notes icon indicating copy to clipboard operation
github-release-notes copied to clipboard

gren init with token option

Open dlsrb6342 opened this issue 5 years ago • 9 comments

When run gren init --token=******, it doesn't work well. I got following error log.

Can't find GREN_GITHUB_TOKEN. Please configure your environment
See https://github.com/github-tools/github-release-notes#setup

Can't I use gren init with token option?

dlsrb6342 avatar Jan 07 '20 08:01 dlsrb6342

Maybe you are right, gren init doesn't have this option. My try:

gren init --token=****
error: unknown option `--token'

For another way, just like the error log, you should add the token to ~/.bash_profile (or ~/.zshrc). see https://github.com/github-tools/github-release-notes#setup.

If you've already done it.gren init is ok.

yansheng836 avatar Jan 07 '20 09:01 yansheng836

Yes I know that. If I add environment variable(GREN_GITHUB_TOKEN), it works well. Actually, I want to use all gren command with --token=*** option.

dlsrb6342 avatar Jan 08 '20 06:01 dlsrb6342

The gren init is just to create the configuration file, which you can use together with the --token option.

You should run gren release|changelog --token instead?

alexcanessa avatar Jan 08 '20 15:01 alexcanessa

Then, if I don't set GREN_GITHUB_TOKEN variable, Can't I use gren init?

dlsrb6342 avatar Jan 09 '20 08:01 dlsrb6342

You can:

$ gren init

🤖 : Hello, I'm going to ask a couple of questions, to set gren up!

? What type of APIs do you need? Normal
? Where shall I get the informations from? Issues (Time based)
? Do you want to add a prefix to release titles? e.g. v
? Do you want to only include issues/prs that belong to a milestone? No
? Do you want to ignore tags containing certain words? No
? Do you want to group your notes? No
? What file name do you want for your changelog? CHANGELOG.md
? Which extension would you like for your file? .grenrc.yml

Great news! Your .grenrc.yml as been created!

  $ cat .grenrc.yml
---
  dataSource: "issues"
  prefix: ""
  onlyMilestones: false
  groupBy: false
  changelogFilename: "CHANGELOG.md"

And then run

$ gren release --token=xyz

alexcanessa avatar Jan 09 '20 16:01 alexcanessa

image Without GREN_GITHUB_TOKEN environment variable, I got error.

dlsrb6342 avatar Jan 15 '20 09:01 dlsrb6342

Oh! Weird. Bug then 😅

alexcanessa avatar Jan 15 '20 10:01 alexcanessa

Yes. And also, I think if we can set token value in config file, it would be better to use.

dlsrb6342 avatar Jan 15 '20 10:01 dlsrb6342

The token shouldn't be saved in the config file as could be committed and not secure.

alexcanessa avatar Jan 15 '20 11:01 alexcanessa