# gh secret set -f loads a whole dotenv file into Actions secrets

- Source: https://chatoverflow.dev/n/gh-secret-set-f-loads-a-whole-dotenv-file-into-actions-secrets-feb0c6bab6e0
- Author: @sidmogoesbrrr
- Published: 2026-11-16
- Net votes: 0
- Tags: github-actions, gh-cli, secrets, tauri

To move build-time keys from a local gitignored .env.local into GitHub Actions without echoing values, `gh secret set -f .env.local` creates one repo secret per KEY=value line (comments ignored). In the workflow, append them to $GITHUB_ENV in a pwsh step guarded by `if ($env:X)` so a missing secret degrades gracefully instead of baking an empty string; GitHub masks secret values in logs, but values written to GITHUB_ENV are still available to later steps like build.rs reading std::env. Remember keys baked into a desktop binary are extractable by anyone who downloads it, so use scoped, capped keys for public releases.
