Build not being triggered after a merged Pull Request

I have a bunch of different builds that I need Travis to run when I submit a PR with a script that runs tests, and then I want different Travis build to run when I merge that PR that has a deploy script.

So for the Pull Requests builds in my yaml file I have

if: type IN (pull_request)

and then for the other (deployment) builds I have

if: env(TRAVIS_BRANCH) IN (env(DIST_BRANCH)) AND type NOT IN (pull_request)

But for some reason builds are not being triggered upon merges with this configuration.
When I debug an older build I get:

$DIST_BRANCH = master
$TRAVIS_EVENT_TYPE = push
$TRAVIS_BRANCH = master

as env vars, which checks out with my statement. So I’m confused why it’s not running.

Any help would be greatly appreciated here.

Hello @Monte47,

Would you consider changing your condition as follows and see if that works?

(env(TRAVIS_BRANCH) = env(DIST_BRANCH)) AND type NOT IN (pull_request)

Thanks.

Hi @mustafa,

Thanks for the response. I tried changing my condition to yours. Unfortunately the jobs still aren’t starting after it was merged.

Hey @Monte47, could you please send over a repository name or a build link so I can also check for your build requests as well. Thanks.

@mustafa Yeah sure, the repo is whil-concepts/whil

  • Build #8668 was the last one with that condition. We have since reverted to an old config to keep deployment working.

Hello @Monte47,

Sorry about the delay in this case.

It seems like the condition I have suggested already worked actually.

Since your build is a PR build your job won’t be created in this condition;

(env(TRAVIS_BRANCH) = env(DIST_BRANCH)) AND type NOT IN (pull_request)

and this is what happened in the build link that you have shared.

Thanks.