-
-
Notifications
You must be signed in to change notification settings - Fork 820
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
Allow hooks file to be parsed as a template #161
Conversation
Any updates on the state? :) |
b5bca38
to
b4cb248
Compare
Add a -template command line option that instructs webhook to parse the hooks files as Go text templates. Includes a `getenv` template func for retrieving environment variables.
b4cb248
to
f5f04dd
Compare
I think this is ready for review and merging. It's fairly straight-forward. Let me know if you have any questions. |
This looks awesome! Could you please update the wiki parameters (and perhaps create a separate page showing a simple use case how to use this. also don't forget to link to https://golang.org/pkg/text/template/ for those who would like to try more esoteric stuff with templates) |
I updated the Webhook Parameters page just now. Instead of creating a new wiki page, would it make more sense to add a short section about templates to the Readme? |
Maybe we should go with the different approach. The wiki approach is a little bit flawed, as in, it is strongly related to the the latest release. How about we add How does that sound? Maybe you have a better approach to all of this? |
Sounds good. 👍 |
Of course this should be a separate issue from this topic :-) Thanks for this contribution and making webhook even more awesome! |
Add a -template command line option that instructs webhook to parse the hooks files as Go text templates.
This is a quick proof-of-concept. Needs tests. I may not be able to work on this for several days, but I wanted to push it out to see what others think about this approach.
Updates #160