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$).+
    

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠