Reputation: 286
I'm trying to setup the pull request plugin. I've configured it as suggested in the documentation but if I specify the branch to build as ${sha1} then that variable doesn't seem to be resolved. So in my logs:
Building in workspace /Users/sat/.jenkins/jobs/JenkinsTest/workspace
> /usr/local/bin/git rev-parse --is-inside-work-tree
Fetching changes from the remote Git repository
> /usr/local/bin/git config remote.origin.url [email protected]:stucker/tester.git
Fetching upstream changes from [email protected]:stucker/tester.git
> /usr/local/bin/git --version
> /usr/local/bin/git fetch --tags --progress [email protected]:stucker/tester.git +refs/pull/*:refs/remotes/origin/pr/*
> /usr/local/bin/git rev-parse origin/${sha1}^{commit}
> /usr/local/bin/git rev-parse ${sha1}^{commit}
But I don't know why that wouldn't work. This is coming off of a push triggered by the standard web hook
Upvotes: 3
Views: 1050
Reputation: 286
I found that you can't run the regular build hook and the pull request on the same job - I had to have separate jobs - one for doing a regular build, and one for doing a pull request build. With that everything works fine.
Upvotes: 3
Reputation: 1324606
If you get
Failed to rev-parse: origin/${sha1}
No candidate revisions
, it could be related to issue 5.
A couple of suggestions:
5#issuecomment-14308061:
I just had the same issue with v1.5 and I got it solved by cloning the job and deleting the old one.
5#issuecomment-19826662:
In my case, "Branches to build
" field in jenkins configuration form was like "feature/abc/main
". My colleague @defragged
has suggested to specify branch name without forward slashes ("/
"). So I checked out new branch "abcMain
" of "feature/abc/main" and build the job. It worked for me.
5#issuecomment-24628027:
I was having the same problem with a Github Pull Request job, and it turned out I was missing the necessary refspec "+refs/pull/:refs/remotes/origin/pr/
" from my job.
JENKINS-20502 "Cannot find any revision to build on clean workspace" (which doesn't seem to be in included in a Jenkins release yet)
Other open issues for the GitHub pull request builder plugin (repo janinko/ghprb
, forked at jenkinsci/ghprb-plugin), like issue 17097.
Upvotes: 0