Generate .env when run shipjs setup
See original GitHub issueIs your feature request related to a problem? Please describe.
When we run shipjs prepare
at local, .env is needed.
But Shipjs’s log when run command shipjs setup
does not explain that thing.
Describe the solution you’d like I want to propose two ways.
- Generate
.env
when runnpx shipjs setup
#======= Attention: Please don't commit this file =======
# Used when using the `shipjs prepare` command
GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>
- Include this text in log when finished
shipjs setup
:create .env file on project's root. The file used when run shipjs prepare
Describe alternatives you’ve considered
Additional context
If already exists .env
, insert text to the file.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Getting Started | Ship.js - Algolia Community
This interactive CLI will help you install Ship.js into your package and create ... GITHUB_TOKEN=xxx shipjs prepare; Create a file named ".env" and...
Read more >Next.js environment variables - Refine Dev
We will take a closer look at environment variables in Next.js.
Read more >How to set environment variables from within package.json?
For a test you can see the env variables by running npm run env-linux or npm run env-windows , and test that they...
Read more >Advanced Usage of Pipenv - Read the Docs
pipenv install --deploy. This will fail a build if the Pipfile.lock is out–of–date, instead of generating a new one. Or you can install...
Read more >Angular Basics: Environmental Variables—Build Configurations
Angular Basics: Using Environmental Variables To Organize Build ... Package Manager version 6.7 (it usually ships with Node installation) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m actually increasingly convinced that having a .env in the root of a package that you will publish is too risky, we have also published tokens by accident (by doing the publish on a local machine when CI failed), and that’s a design we want to avoid! Either shipjs creates it, but also creates all files to be sure it’s ignored, or we recommend passing the token as an environment variable only.
Did anyone do research on how other publish scripts solve this?
We have this step in
shipjs prepare
: https://github.com/algolia/shipjs/blob/12c21cefa20f0f35153c81e9a6fdd2ffdc369bac/packages/shipjs/src/step/checkGitHubToken.js#L6:L6If I understand your intention correctly, you think it’s a bit too late and you’d like to get the information at the time of
shipjs setup
. Right?