{"id":15045314,"url":"https://github.com/jenkinsci/webhook-step-plugin","last_synced_at":"2025-04-09T20:05:29.511Z","repository":{"id":38856149,"uuid":"86359489","full_name":"jenkinsci/webhook-step-plugin","owner":"jenkinsci","description":"Jenkins Pipeline plugin for blocking a pipeline until an external system calls a webhook.","archived":false,"fork":false,"pushed_at":"2025-04-08T17:53:55.000Z","size":309,"stargazers_count":37,"open_issues_count":5,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T20:05:25.209Z","etag":null,"topics":["java"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/webhook-step/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"cpitman/webhook-step","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-27T16:37:26.000Z","updated_at":"2025-04-04T04:18:52.000Z","dependencies_parsed_at":"2023-02-16T18:15:47.918Z","dependency_job_id":"15a38d98-8f1a-4d2e-b2d6-6949ad5f1d4e","html_url":"https://github.com/jenkinsci/webhook-step-plugin","commit_stats":{"total_commits":263,"total_committers":14,"mean_commits":"18.785714285714285","dds":"0.36882129277566544","last_synced_commit":"16d2a86d9fdd000601df7bfdc26ac03b08d59a7e"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fwebhook-step-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fwebhook-step-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fwebhook-step-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fwebhook-step-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/webhook-step-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103871,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java"],"created_at":"2024-09-24T20:51:43.331Z","updated_at":"2025-04-09T20:05:29.480Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Webhook Step Plugin\n===================\n\nThis pipeline plugin provides an easy way to block a build pipeline until an\nexternal system posts to a webhook.\nIt can be used to integrate long running tasks into a pipeline, without busy waiting.\n\nA typical example is launching a performance test on a dedicated hardware/configuration.\nWhen the task completes, it can easily notify the waiting pipeline.\nThe webhook payload can be used to provide information like results or other useful data.\n\n\nSee the original discussion [\"Waiting for Remote Systems in a Jenkins Pipeline\"](https://cpitman.github.io/jenkins/cicd/2017/03/16/waiting-for-remote-systems-in-a-jenkins-pipeline.html).\nIt explains the context that triggered writing this plugin.\n\nUsage\n-----\n\nUsing this plugin will usually require 3 steps:\n\n1. Register a webhook\n2. Start a long running task while providing the webhook url for callback\n3. Wait for the webhook to be executed\n\nFor example, the following pipeline script writes out the webhook url to the log\nand waits for a user to call it:\n\n```groovy\nhook = registerWebhook()\n\necho \"Waiting for POST to ${hook.url}\"\n\ndata = waitForWebhook hook\necho \"Webhook called with data: ${data}\"\n```\n\nWhen this job is executed, something like the following log is printed:\n\n```\nWaiting for POST to http://localhost:8080/webhook-step/bef13807-a161-4193-ab95-6cb974afc71d\n```\n\nTo continue the pipeline, we can post to this url. To do this with curl, execute\n`curl -X POST -d 'OK' http://localhost:8080/webhook-step/bef13807-a161-4193-ab95-6cb974afc71d`.\n\nThe blocking `waitForWebhook` call will then complete.\nThe returned data is the posted JSON payload.\nWith the above curl example it would be `OK`.\nThe log file will thus show `Webhook called with data: OK`.\n\nFor illustration, see the [scripted pipeline example](examples/scripted_pipeline).\n\n\nAccessing hook data\n-------------------\n\n- **Token:** `hook.token` / `hook.getToken()`\n- **Url:** `hook.url` / `hook.getUrl()`\n\n###### Deprecation notice:\n\n`getURL()` is *deprecated* and will be removed in a future release.\n\n\nSpecifying a fixed webhook name\n-------------------------------\n\nInstead of letting the plugin generate a unique webhook ID, you can provide a name at creation.\nLike this: `hook = registerWebhook(token: \"my_webhook\")`.\n\nThe [declarative pipeline example](examples/declarative_pipeline) illustrates this.\n\n\n**caveat**: if several job instances use the same token, only the most recent job will trigger.\n\n\nSecuring the webhook with an authentication token\n-------------------------------------------------\nIt is possible to specify an authentication token.\nThis token has to be provided in the header of the webhook HTTP POST for the wait to complete.\n\nTo avoid secret leakage in the pipeline source code or logfiles, it is strongly advised to use a \"secret text\" credential.\nThe [declarative_withAuthToken](examples/declarative_withAuthToken) example illustrates how to use a webhook step authentication token stored as a secret (`webhook_secret`).\n\nTo trigger that webhook, the `curl` command would look like: `curl -X POST -d 'OK' -H \"Authorization: 123\" \u003cJENKINS_URL\u003e/webhook-step/test-webhook`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fwebhook-step-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fwebhook-step-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fwebhook-step-plugin/lists"}