-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
fix: Improve README and drop quotes from hook env vars #651
fix: Improve README and drop quotes from hook env vars #651
Conversation
Wow, thanks for the quick PR. I'd prefer not to change functionality and to just change the README instead of adding code to implicitly strip quotes. Instead just add documentation around the existing behavior... Just say everything before the |
As you've found, the existing code adds extra quotes (or to be precise doesn't remove them whereas it apparently should be doing so). So why would we want to keep them? Instead we'd prefer to be consistent with how the shell exports vars. |
Re the changing the README, I don't think we should be dropping quotes from there as they serve to prevent word splitting and to distinguish (to delimit) the content of the inner (nested) var passed to the hooks as an env var. |
There is no word splitting as it's coming from yaml. It'll always be a single string. |
I'm not following your point. |
To me it's unclear what is supposed to process that line. Is it re-interpreted as Bash?... I would argue that it shouldn't. Does it also support single quotes or just double? Does it support escape characters? Does it support Even if you decide to only support double quotes, what if a value needs to contain a double quote... How are they to be escaped? What if it starts with a quote but doesn't contain a closing quote. Is that an error? I just need the behavior completely specified so I can move forward with a Python implementation for #648 For me it'd just be easier to choose some separation character, like |
@ericfrederich Please move the discourse and the discussion to #648 You can find most of the answers for the most of your questions in ps: continuation of discourse in this PR will result in the conversation being locked to contributors only. Thanks for your understanding 🤝 |
Config example: | ||
|
||
```yaml | ||
- id: terraform_validate | ||
args: | ||
- --env-vars=AWS_DEFAULT_REGION="us-west-2" | ||
- --env-vars=AWS_ACCESS_KEY_ID="anaccesskey" | ||
- --env-vars=AWS_SECRET_ACCESS_KEY="asecretkey" | ||
- --env-vars=AWS_PROFILE="my-aws-cli-profile" |
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.
Btw, I found out why that functional was implemented - #116
No idea if is it worth highlighting such hack option in docs examples :)
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.
The options is nice I reckon. And the PR was not about it but to remove insecure example =)
Oops, requested re-review because didn't notice the approve was already provided =) |
## [1.88.4](v1.88.3...v1.88.4) (2024-03-25) ### Bug Fixes * Improve README and drop quotes from hook env vars ([#651](#651)) ([daec682](daec682))
This PR is included in version 1.88.4 🎉 |
Put an
x
into the box if that apply:Description of your changes
Fixes #650
README
by replacing sensitiveAWS_
creds vars withAWS_PROFILE
Kudos to @ericfrederich for spotting and reporting that