mirror of
https://github.com/jbranchaud/til
synced 2026-01-20 23:48:02 +00:00
Compare commits
3 Commits
8ebda94bc5
...
180cb470f6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
180cb470f6 | ||
|
|
c8445c45a9 | ||
|
|
15337dfd71 |
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||||
|
|
||||||
_1608 TILs and counting..._
|
_1609 TILs and counting..._
|
||||||
|
|
||||||
See some of the other learning resources I work on:
|
See some of the other learning resources I work on:
|
||||||
- [Ruby Operator Lookup](https://www.visualmode.dev/ruby-operators)
|
- [Ruby Operator Lookup](https://www.visualmode.dev/ruby-operators)
|
||||||
@@ -691,6 +691,7 @@ If you've learned something here, support my efforts writing daily TILs by
|
|||||||
### Mise
|
### Mise
|
||||||
|
|
||||||
- [List The Files Being Loaded By Mise](mise/list-the-files-being-loaded-by-mise.md)
|
- [List The Files Being Loaded By Mise](mise/list-the-files-being-loaded-by-mise.md)
|
||||||
|
- [Read Existing Dot Env File Into Env Vars](mise/read-existing-dot-env-file-into-env-vars.md)
|
||||||
|
|
||||||
### MongoDB
|
### MongoDB
|
||||||
|
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ version from my `.tool-versions` file with a step that uses `set-output`.
|
|||||||
- name: Read Node.js version to install from `.tool-versions`
|
- name: Read Node.js version to install from `.tool-versions`
|
||||||
id: nodejs
|
id: nodejs
|
||||||
run: >-
|
run: >-
|
||||||
echo "::set-output name=NODE_VERSION::$(
|
echo "NODE_VERSION=$(
|
||||||
cat .tool-versions |
|
cat .tool-versions |
|
||||||
grep nodejs |
|
grep nodejs |
|
||||||
sed 's/nodejs \(.*\)$/\1/'
|
sed 's/nodejs \(.*\)$/\1/'
|
||||||
)"
|
)" >> $GITHUB_OUTPUT
|
||||||
```
|
```
|
||||||
|
|
||||||
`echo` runs the command in the string which sets `NODE_VERSION` as an output
|
`echo` runs the command in the string which sets `NODE_VERSION` as an output
|
||||||
@@ -45,4 +45,4 @@ This output value can be referenced in a later step.
|
|||||||
`steps` has a reference to the `nodejs` step (note the `id` above) which then
|
`steps` has a reference to the `nodejs` step (note the `id` above) which then
|
||||||
has `outputs` like the `NODE_VERSION`.
|
has `outputs` like the `NODE_VERSION`.
|
||||||
|
|
||||||
[source](https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#using-workflow-commands-to-access-toolkit-functions)
|
[source](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter)
|
||||||
|
|||||||
28
mise/read-existing-dot-env-file-into-env-vars.md
Normal file
28
mise/read-existing-dot-env-file-into-env-vars.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Read Existing Dot Env File Into Env Vars
|
||||||
|
|
||||||
|
Just about any web app that I've worked on has had a `.env` file as a way of
|
||||||
|
configuring aspects of the app specific to that environment. These typically
|
||||||
|
are read into the environment with a language-specific
|
||||||
|
[dotenv](https://github.com/bkeepers/dotenv) tool.
|
||||||
|
|
||||||
|
Mise supports this convention. In addition to specifying individual non-secret
|
||||||
|
env vars, you can also instruct `mise` to read-in a `.env` file like so:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[env]
|
||||||
|
PORT=3344
|
||||||
|
_.file = ".env"
|
||||||
|
```
|
||||||
|
|
||||||
|
The `_.file` line tells `mise` that there is a file `.env` with key-value pairs
|
||||||
|
that it should read in. It can even handle `.env.json` and `.env.toml` file
|
||||||
|
formats.
|
||||||
|
|
||||||
|
To ensure that `mise` is picking up the values from the `.env` file, you can
|
||||||
|
run the following command and make sure they show up in the output:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ mise env
|
||||||
|
```
|
||||||
|
|
||||||
|
[source](https://mise.jdx.dev/environments/secrets.html)
|
||||||
Reference in New Issue
Block a user