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
gefragt vor 9 Monaten268 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 9 Monaten
  • 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$).+
    

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen