When specifying git url with a branch parameter inside jenkinsfile and creating a pull request jenkins indexes the pull request branch but when runs a build it returns:
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE
The git url command in jenkinsfile goes like:
git url: 'ssh://git@x.git', credentialsId: 'x', branch: '$BRANCH_NAME'
Jenkins builds correctly on a standard branch, while running the same build on a pull request fails.
When specifying git url with a branch parameter inside jenkinsfile and creating a pull request jenkins indexes the pull request branch but when runs a build it returns: ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Finished: FAILURE
The git url command in jenkinsfile goes like: git url: 'ssh://git@x.git', credentialsId: 'x', branch: '$BRANCH_NAME'
Jenkins builds correctly on a standard branch, while running the same build on a pull request fails.