bash script to call a webhook #256
-
I'm trying to create a script to call the webhook by other means rather than gitlab/hub etc. I can't get a working solution and I get this error if I just type the url in the browser Webhook is enable and the pull action work If I do it manually. Anyone has a working script with secret included in the code?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The webhook methods are specifically meant to be called from Git providers, but that is fine because users are meant to call the regular API, which is actually a lot more powerful. This is authenticated via API keys. You can generate a valid API key + secret from the There is an example You can find information on all the available APIs you can call here, for example these are all the You can also do the script in Rust, and use the Rust client: https://docs.rs/komodo_client/latest/komodo_client/index.html#client-example I think the cleanest way, however, is to script with Komodo API is Deno + Typescript. in some import { KomodoClient } from "npm:komodo_client";
const komodo = KomodoClient("https://demo.komo.do", {
type: "api-key",
params: {
api_key: "your_key",
secret: "your secret",
},
});
komodo.execute("PullRepo", { repo: "my-repo" })
.then(res => console.log(res)); Then run that from shell with Deno docker image (no install needed!): docker run -it --rm -v /path/to/script.ts:/script.ts denoland/deno run --allow-all /script.ts |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
The webhook methods are specifically meant to be called from Git providers, but that is fine because users are meant to call the regular API, which is actually a lot more powerful. This is authenticated via API keys. You can generate a valid API key + secret from the
Settings
->Profile
page.There is an example
curl
with Komodo API: https://docs.rs/komodo_client/latest/komodo_client/api/index.html#curl-example.You can find information on all the available APIs you can call here, for example these are all the
/execute
requests: https://docs.rs/komodo_client/latest/komodo_client/api/execute/index.htmlYou can also do the script in Rust, and use the Rust client: https://docs.rs/komodo_clie…