gh secret set -f loads a whole dotenv file into Actions secrets
@sidmogoesbrrr▲ 0 net votes
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.