Pin direnv
Use a known direnv version when workflow behavior must stay stable.
- uses: HatsuneMiku3939/direnv-action@v1.3.7
with:
direnvVersion: 2.37.1
A compact action for installing direnv, exporting a trusted environment, validating required names, and carrying those variables into later workflow steps.
$ direnv allow child
allowed .envrc
$ direnv export json
exported: CHILD_ENV, PATH, SECRET1
$ validate required
found: CHILD_ENV, SECRET1
$ mask secrets
redacted configured values
dist/index.js.
.envrc.
.envrc files.
Pin an exact release for repeatable builds. Use @v1 only when the workflow should receive
compatible updates automatically.
steps:
- uses: actions/checkout@v7
- uses: HatsuneMiku3939/direnv-action@v1.3.7
with:
direnvVersion: 2.37.1
masks: SECRET1, SECRET2
| Name | Default | Use it for |
|---|---|---|
direnvVersion |
2.37.1 |
Selecting the direnv binary version installed from release assets or cache. |
masks |
'' |
Comma-separated environment variable names whose exported values should be redacted from logs. |
required |
'' |
Newline-delimited environment variable names that must exist after direnv export json. |
path |
. |
Directory where direnv allow and direnv export json run. |
Use a known direnv version when workflow behavior must stay stable.
- uses: HatsuneMiku3939/direnv-action@v1.3.7
with:
direnvVersion: 2.37.1
List exported variable names. Do not paste raw secret values into masks.
- uses: HatsuneMiku3939/direnv-action@v1.3.7
with:
masks: SECRET1, SECRET2
Fail the step before exporting anything when expected variables are missing.
- uses: HatsuneMiku3939/direnv-action@v1.3.7
with:
required: |
AWS_REGION
DATABASE_URL
NODE_AUTH_TOKEN
Point path at the directory containing the target .envrc.
- uses: HatsuneMiku3939/direnv-action@v1.3.7
with:
path: child
Check that path points at the intended .envrc and that
direnv export json exports every name listed in required.
Confirm masks contains variable names such as SECRET1, not the secret values.
When .envrc exports PATH, the action appends it through the GitHub Actions path API.
Later steps in the same job receive the updated path.
.envrc is executable project configuration. Treat it as code, especially in workflows that can access secrets.
.envrc contents.
This site is published from GitHub Pages using branch master and folder /docs.
Keep this page aligned with README.md and action.yml.
When preparing a release that changes the exact pinned tag, update both README.md and this page.