How to trigger webhook on a resource?

I saw in the resource documentation that I can use a webhook_token on a resource. Which I’m doing like this:

- name: devops-repo
  type: git
    branch: master
    private_key: ((private_key))
  webhook_token: foobarbaz
  check_every: 24h

- name: some-job
    get: devops-repo
    trigger: true

So how can I actually trigger this resource? If I curl it with a GET request using curl https://CONCOURSE_URL/api/v1/teams/main/pipelines/MY-PIPELINE/resources/devops-repo/check/webhook?webhook_token=foobarbaz, then I get a method not allowed error. If I curl it with a POST using curl -X POST https://CONCOURSE_URL/api/v1/teams/main/pipelines/MY-PIPELINE/resources/devops-repo/check/webhook?webhook_token=foobarbaz, I get a 200 response, but no other feedback to curl, and my pipeline does not fire.

Anyone have an example of how to curl a pipeline using a webhook_token?

Additionally, if I only care about triggering this pipeline with HTTP webhook requests (or manually, in the Concourse UI), and I never want to trigger it based on git commits, do I still need trigger: true?

Thanks in advance.

Hmm… you might need to use something else to manually trigger pipelines (like something that automates fly). Webhooks are just for manually initiating a resource check. You also cannot disable automatic checking when using webhooks.

Setting “trigger” controls whether that job automatically runs when it sees new versions available from the resource, regardless of if the new version that resource saw was from a time-based check or a webhook initiated check.

Hello @jwr,

Provided your team name is main, a request on the URL you mention should trigger a new check in your devops-repo resource.

You can have a look at the following GitHub Actions that details how to implement this :

This GitHub Action will help you switch from a “pull” pattern (Concourse checking regularly GitHub for new commits) to a “push” pattern (Github telling Concourse to have the git resource check for new commits).

Hopes this helps