简体   繁体   中英

What is the correct post request body for AWS Codepipeline webhook?

I have a codepipeline webhook defined below:

webhooks:
- arn: arn:aws:codepipeline:eu-west-1:$$$:webhook:codepipeline-webhook-test-staging
  definition:
    authentication: UNAUTHENTICATED
    authenticationConfiguration: {}
    filters:
    - jsonPath: $.ref
      matchEquals: refs/heads/{Branch}
    name: codepipeline-webhook-test-staging
    targetAction: Source
    targetPipeline: test-staging-pipeline
  tags: []
  url: https://eu-west-1.webhooks.aws/

I want the pipeline to fire whenever there is a post request to that url. I've tried posting with no body which returns http 200 but the pipeline hasn't triggered and I've tried different permutations of the following:

{
    "ref": "staging"
}
or
{
    "ref": "refs/heads/staging"
}

What is the correct json body to trigger the pipeline?

@gshpychka's answer worked for me:

Set the filter to matchEquals: refs/heads/staging

Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM