Comments (7)
Thanks for the write up! I'll take a look into this as soon as possible and will post you with an update and a solution... :-)
The thing with the form-encoded payload in webhook at the moment is that you can only get values of the passed variables, in your case being payload variable with the JSON payload. So basically you can pass that JSON string to your script and then parse it inside and extract the values you are interested in.
I will see what modifications can I incorporate into webhook to make it easier for this scenario...
from webhook.
I'm thinking about adding a property on the hook named json-parameters
which would contain a list of parameters that the user expects to contain JSON strings. Upon receiving the request, webhook would then try to parse those values as JSON and the user could use them just like the parameters in JSON formatted payload. (parameter.key.anotherkey
). Solving the issue you currently have... What do you think?
from webhook.
So as an example, I could define "json-parameters": [ "mypayload" ]
in hooks.json, and webhook would decode the mypayload
form variable as JSON. Then I would reference the JSON items like this:
{
"match": {
"type": "value",
"parameters": {
"source": "payload",
"name": "mypayload.commits.0.branch"
},
"value": "needle"
}
}
I like the idea.
However, json-parameters
sounds a little ambiguous to me. It might confuse people into thinking it has something to do with the match.parameter
triggers from the hook package. What about http-json-parameters
? But either way, you make the call. It'll be great. 😄
from webhook.
Exactly that. Maybe parse-parameters-value-as-json
? :-)
from webhook.
I'll get this done tonight.
from webhook.
Success!!
from webhook.
Awesome! :-)
from webhook.
Related Issues (20)
- Broadcasting Slack Slash Command's Response HOT 1
- Header evaluation is broken HOT 4
- Step-by-step tutorial for a 'Hello world'
- Vulnerabilities of dependency "gopkg.in/yaml.v2"
- webhook hook not running bash script HOT 6
- Bitbucket now supports webhook secrets 🥳 HOT 1
- I found that I can't use dot-notation to contain all sub-objects in my json
- I need to parse url for addr:port HOT 1
- Update `go` installation
- Ubuntu Webhooks is not reading the correct RVM ruby installed HOT 2
- Custom logging
- Webhook id is not being served in URL HOT 2
- how to set shell $PATH HOT 4
- Weird Cert issue when calling webhook from shell HOT 1
- pass-file-to-command as optional HOT 1
- Add a (unique) folder with images for dynamic responses HOT 7
- Question - How long does the webhook service run
- Add hook property to control command output logging
- New WebHook, Docker, Env Support, Clean codebase 🎉
- amd64 does not works pre compiled? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webhook.