AWS CodeBuild Console Start build with Webhook Events

0

Hello, My CodeBuild is failing to trigger on PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED when I add "!refs/heads/main" in the HEAD_REF optional field.

Enter image description here

In the POST request json object, the head.ref value is "test_codebuild".

I'm trying to trigger the build when the branch is not the "main" branch. In the Github webhook response, I'm seeing the message "{"response":"No build triggered for specified payload","statusCode":200}".

Can someone point me to right direction if I only want to trigger the CodeBuild if is on a feature branch?

Thank you.

dc
已提问 9 个月前268 查看次数
1 回答
0

I thought I would make the following regular expression and then build it with the changes to the feature branch.
Try changing the value of head.ref as follows.

^refs/heads/feature.*$
profile picture
专家
已回答 9 个月前
  • Which means that I have to name all the branches starting with "feature". I want to be able to name the branch as anything.

  • The following is a regular expression that will respond if it is not a main branch. Can you confirm that it works here?

    ^refs/heads/(?!main$).+
    

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则