Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: support branch specific secrets #29

Closed
erezrokah opened this issue Mar 9, 2022 · 1 comment · Fixed by #33
Closed

Feat: support branch specific secrets #29

erezrokah opened this issue Mar 9, 2022 · 1 comment · Fixed by #33

Comments

@erezrokah
Copy link
Contributor

Which problem is this feature request solving?

The plugin supports CONTEXT specific secrets by setting a NETLIFY_CONTEXT tag in AWS Secrets manager.
It can be useful to add NETLIFY_BRANCH support too.

Describe the solution you'd like

If a NETLIFY_BRANCH tag is added to a secret in AWS, we should only inject that secret to the matching branch

Describe alternatives you've considered

N/A

Can you submit a pull request?

Yes

@erezrokah
Copy link
Contributor Author

More on this, the plugin uses the CONTEXT env variable to filter secrets. It can only have 3 values: production, deploy-preview or branch-deploy.

Since context can also mean branch name (in netlify.toml), and the branch is available via the HEAD environment variable this could be as simple as adding HEAD to the condition here

if (CONTEXT === context) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant