aws-secretsmanager-get-secrets icon indicating copy to clipboard operation
aws-secretsmanager-get-secrets copied to clipboard

Don't fail when no secrets are present

Open cloudshiftchris opened this issue 1 year ago • 1 comments

Currently, when loading secrets, if no secrets are found an exception is thrown:

if (secretsList.length === 0){
      throw new Error(`No matching secrets were returned for prefix "${prefix}".`);
}

There are valid use cases where secrets may not (yet/ever) be present, such as using this action in a reusable composite GitHub Action, where any given repository may access AWS accounts that may or may not have secrets in Secrets Manager (if they do, they will be exposed).

Proposing adding a flag such as fail-on-empty-secrets to facilitate this.

cloudshiftchris avatar Apr 29 '24 23:04 cloudshiftchris

Thanks for the report, @cloudshiftchris. We have added this as an enhancement request.

jbct avatar May 13 '24 18:05 jbct