Pipeline not triggered for pull requests

Hello community.

I am trying to implement a pipeline that follow the gitflow branching model, when the pipeline needs to be triggered:

  • when there is a pull request from feature/*** into the branch develop
  • when there is a push commit into develop (when the PR is merged) and into the release branch (when the release branch is created)

I set up 2 triggers:

The push commit trigger for develop and release branchs is working fine, but the pull request is never triggered. I am not sure what I am missing in the configuration. I see github sending the web hook when I open and reopen my PR, but build is never triggered (I did not select all PR events, only PR opened and reopened).

repository: https://github.com/thiagolocatelli/spring-petclinic

Suggestion: for each BUILD, provide a link or something where we can see which trigger was activated for that build, the same way it is displayed in the logs when a condition is evaluted.

Looks like your regex needs adjusted, try the following:

Branch Regex: /^feature\/.*$/gi
PR Target Branch Regex: /^develop$/gi (unless you actually want people to be able to commit to develop*)

You probably want to change the regex for the push commits too:

Branch Regex: /^(develop|release\/.*)$/gi

I did change the regex and I see all the requests coming in the Audit screen (I didnt know about it), but my trigger is still not being triggered when an event for pull request triggers. I am wondering if the free account has limitations on how many or what types of triggers can be used because any regex tool out there says the regex matched the branch names so the trigger should be executed.

@dcunningham I found out the issue. My repo was a fork from another repo, as soon as I recreated my repo without being a fork, the PR’s started working. thank you for the suggestions on the regular expressions.

Glad to hear it Thiago!

Just wanted to add that several of Codefresh capabilities depend on the webhook payload that the Git provider sends to the platform. In several cases some things are missing (e.g. changed files on pull requests)