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
demandé il y a 9 mois268 vues
1 réponse
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
EXPERT
répondu il y a 9 mois
  • 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$).+
    

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions