-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add support for environment variable validations #546
Conversation
@EmilyGraceSeville7cf - would you mind double checking my schema changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😄 I have some notes about changes, but they are not required to be applied.
"validate": { | ||
"title": "validate", | ||
"description": "A validation function for the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#validate", | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"type": "string", | |
"type": "string", | |
"minLength": 1, | |
"pattern": "^\\s+|\\s+$" |
I suggest adding more validations. I am not sure whether spacing matters, but I would prefer to have spacing checks done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I applied the correction in the strings.json. As for the bashly.json, I am leaving it as is. Rationale:
- the bashly.json is generated from support/schema/bashly.yml
- the new
validate
inenvironment_variables
is a copy-paste from the same function inargs
andflags
- I prefer these schemas to be a guide rather than being a complete lockdown on the exact requirements. Easier to maintain.
If you feel strongly otherwise, I might accept a separate PR with changes to bashly.yml rather than the JSON artifact.
Co-authored-by: Maisa Unbelievable <EmilyGraceSeville7cfg@gmail.com>
Adds support for using
validate
(custom validations) in environment variables.Discovered in #545
Todo
bashly docs
commandSample bashly.yml