Skip to content

Setting environment secrets results in an invalid secret value #3831

@mislav

Description

@mislav

I am using gh cli version gh version 1.11.0 (2021-06-03) and the following command to update environment secrets for a repo.

gh secret set AWS_DEPLOY_ACCESS_KEY -b"${ac}" --env=dev-private --repo myorg/my-repo-name

I can see the environment secret gets updated (last updated field) after running the command but for some reason it sets an incorrect value in the secret since my workflow with action (aws-actions/configure-aws-credentials@v1) fails with the error.

" Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers".

The same workflow runs successfully if I manually update the environment secrets directly using the browser but if I update the secrets using cli, my action fails with the error.

I am looking forward to help on this issue.

Thanks in advance!
Amit

Originally posted by @akumar1-godaddy in #3814


[mislav's note] It looks like we might be using the wrong public key when encrypting the value. As it stands, we are using the repository public key, but we should be using the one that belongs to the environment.

Ref. #3769 /cc @browniebroke

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions