Yesterday my pullrequest jobs failed with the following output:
11:07:41 > git rev-parse origin/${sha1}^{commit} 11:07:41 > git rev-parse ${sha1}^{commit} 11:07:41 ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
I have made an investigation and saw that in property ${sha1} there was nothing. When i paste an absolute path to pull request builder like pr/341/merge instead of ${sha1} the build works. What it can be?
Git Client Plugin 1.9.0
GitHub API Plugin 1.44
For that purpose, we need to click on the Manage Jenkins option. Step 2: Then, a new tab will open. There we need to click on the Manage Plugin option to add the Credential option there. Step 3: Then we need to click on the Available Tab & we should search for 'Credential' in the search bar provided there.
So "revision" refers to the id you can use as a parameter to reference an object in git (usually a commit). HEAD@{5 minutes ago} is a revision which reference the commit present 5 minutes ago.
I spent a long time on this. The above comment "if I leave this field blank" worked like a charm. In SCM:
1) select Git
2) Name: origin
3) Refspec: +refs/pull/*:refs/remotes/origin/pr/*
4) Branches to build : leave blank
This solved the above error.
According to this, Github branch's default name have been changed from "master" to "main".
So, when creating new jobs for a new repository, you have to set "main" as the branch name instead of "master".
Note that github has way to set "master" (or any other name of your convenience) as default branch name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With