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

validate actions secret names #714

Merged
merged 2 commits into from
Mar 12, 2021

Conversation

bendrucker
Copy link
Contributor

@bendrucker bendrucker commented Mar 1, 2021

This PR implements the secret naming rules described in the GitHub docs:

https://docs.github.com/en/actions/reference/encrypted-secrets#naming-your-secrets

Currently, if a user supplies an invalid secret name, it will be rejected at apply time:

422 Failed to add secret. Name is invalid []

Instead, this makes naming violations raise a clear error at validate/plan time. I've added unit tests against the validation function, similar to how other shared validation functions are handled. Happy to add a full acceptance test for an invalid case if that's of interest.

@jcudit jcudit added this to the v4.6.0 milestone Mar 8, 2021
@issyl0
Copy link
Contributor

issyl0 commented Mar 11, 2021

Thanks for this PR, @bendrucker! I really like this feature - adding error messages is a positive step forward in user friendliness, and the implementation looks OK to me.

@jcudit jcudit merged commit 48af43e into integrations:master Mar 12, 2021
@bendrucker bendrucker deleted the validate-secret-names branch March 12, 2021 21:40
k24dizzle pushed a commit to lyft/terraform-provider-github that referenced this pull request Mar 16, 2021
* validate actions secret names

* remove duplicate case
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
* validate actions secret names

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

Successfully merging this pull request may close these issues.

3 participants