Checkout specific branch not working on push/PR

I saw that Bitrise always was checking out a detached head. So I changed the workflow to checkout develop, because I do versionnumber update in a file and commit it.

Now when a PR is merged, it still does this detached head. But when I do a start build manually, it runs as expected.

I removed the trigger and re-added it, but still the same issue

Ok, never mind!

I read the text now at the top: “If pull_request_id is provided then all other git checkout parameters will be ignored. If a git commit is provided it will ignore the tag and branch parameters. If no git commit but a tag is provided then it will ignore the branch parameter. If no branch parameter is provided then it’ll skip git checkout.”

So I removed the default parameters in these fields and now it always takes ‘develop’

That’s true, but that means you’re not ignoring the commit parameter if I understand it correctly, which means your builds are always testing the head of the branch instead of the commit you can see on the build’s page.

Ideally, if it’s possible, you should avoid pushing back from the build into the repo - please see this discussion for the details: Intermittent build failures to execute push_to_git_remote & how to manage build number

If you’d have any questions just let us know! :wink:

1 Like