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

dotenv support

Open seiyria opened this issue 7 years ago • 10 comments

this would be helpful for people who don't want to save an environment variable somewhere, and would rather keep it project specific.

seiyria avatar Mar 06 '18 17:03 seiyria

Hm, In what way would this help? Can you give us a scenario?

phun-ky avatar Mar 07 '18 19:03 phun-ky

For me, I just like having my config files not contain any code. I'm not sure if there's any benefit per se.

On Wed, Mar 7, 2018, 13:29 Alexander Vassbotn Røyne-Helgesen < [email protected]> wrote:

Hm, In what way would this help? Can you give us a scenario?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/github-tools/github-release-notes/issues/146#issuecomment-371255937, or mute the thread https://github.com/notifications/unsubscribe-auth/AAum2YkcHRE2ficEASKX96RGxwDg95Tkks5tcDUpgaJpZM4SfHEc .

seiyria avatar Mar 07 '18 19:03 seiyria

@seiyria are you saying that you want the GREN_GITHUB_TOKEN in a .env file? Or something else?

phun-ky avatar Mar 07 '18 19:03 phun-ky

Yes, that is correct.

On Wed, Mar 7, 2018, 13:41 Alexander Vassbotn Røyne-Helgesen < [email protected]> wrote:

@seiyria https://github.com/seiyria are you saying that you want the GREN_GITHUB_TOKEN in a .env file? Or something else?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/github-tools/github-release-notes/issues/146#issuecomment-371259593, or mute the thread https://github.com/notifications/unsubscribe-auth/AAum2e2BEoZwNCaoN9FY-h5dBDlWj-5Oks5tcDfngaJpZM4SfHEc .

seiyria avatar Mar 07 '18 19:03 seiyria

Oh shoot. I responded to the wrong thread earlier, sorry. My reasoning for having a .env file contain my token is that I don't have to modify my windows path to add the env variable. If for whatever reason I want to update the token, changing it is easier. If i wanted to have multiple tokens for different orgs or projects I could do that.

It's also nice to have the option to not have to update my global env if for example I move between computers or if I reinstalled my os.

Plus if someone else wanted to edit or update the changelog setting it up would be easier since my project already uses dotenv.

seiyria avatar Mar 07 '18 19:03 seiyria

You can already to that:

In your .env-file:

export GREN_GITHUB_TOKEN="<your token>"

And then if you are using bash:

$ . ./.env gren release ...

phun-ky avatar Mar 07 '18 19:03 phun-ky

Sorry, I mean this dotenv: https://www.npmjs.com/package/dotenv

seiyria avatar Mar 07 '18 19:03 seiyria

Hm, so you can't just create a different .env file and run gren? The way I showed you is exactly with dotenv does, without the bloat.

phun-ky avatar Mar 07 '18 19:03 phun-ky

Your way is also platform dependent (I think). I'm on Windows, and I prefer cross platform solutions where possible.

seiyria avatar Mar 07 '18 19:03 seiyria

I'll dig a little bit more, I think there's something I can do to require dotenv before running a different npm script.

seiyria avatar Mar 07 '18 19:03 seiyria