Skip to content

Adding set secrets from env files#4534

Merged
mislav merged 2 commits intocli:trunkfrom
lpessoa:lp-secret-load-env
Dec 20, 2021
Merged

Adding set secrets from env files#4534
mislav merged 2 commits intocli:trunkfrom
lpessoa:lp-secret-load-env

Conversation

@lpessoa
Copy link
Contributor

@lpessoa lpessoa commented Oct 15, 2021

Fixes #3579
Allows to set multiple secrets using a simple .env file.

gh secret set -f secrets.env

The .env file follows a simple format as defined in godotenv

SPAM="eggs"
FOO="bar"

@lpessoa lpessoa marked this pull request as ready for review October 18, 2021 19:29
@lpessoa lpessoa requested a review from a team as a code owner October 18, 2021 19:29
@lpessoa lpessoa requested review from vilmibm and removed request for a team October 18, 2021 19:29
@mislav mislav added the external pull request originating outside of the CLI core team label Dec 20, 2021
lpessoa and others added 2 commits December 20, 2021 23:33
Allows to set multiple secrets from an env file.

    gh secret set -f secrets.env

The env file follows a simple format as defined in https://github.com/joho/godotenv

    SPAM=eggs
    FOO="bar"
- Store multiple secrets in parallel
- Perform repo ID resolution in parallel with looking up the encryption key
- Avoid resolving repo IDs more than once
- Allow passing `--env-file=-` to read from stdin
- Fix storing user secrets from file
@mislav mislav force-pushed the lp-secret-load-env branch from 7b35ed2 to 95a71f7 Compare December 20, 2021 22:35
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lpessoa Awesome! Thanks for your patience.

I've pushed changes to avoid looking up resolving repo names to IDs more than once, to parallelize setting multiple secrets from file so the whole operation finishes faster, to fix setting Codespace secrets (which is a feature that landed to trunk in the meantime), and to simplify tests.

@mislav mislav merged commit 8272035 into cli:trunk Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh secret load_file envfile

3 participants