Expansion of ${sha1} in Branch specifier not working
See original GitHub issueI am trying to set up the Github Pull Request Builder plugin for our Jenkins server, however sadly the ${sha1}
expansion in the Branch Specifier does not seem to be expanded before the git command is executed.
I can see from the “Console Output” that the ${sha1} is unexpanded in the resulting git command which means that the build fails immediately.
Some things I noticed:
sha1
is included and seems to have the right value in the “Parameters” section of the build- the Jenkins wiki page for GHPRB at https://wiki.jenkins.io/display/JENKINS/GitHub+pull+request+builder+plugin lists
sha1
among the “useful environment variables” that are made available by the plugin - the “Branch Specifier” part of the “Pipeline” section in the job’s configuration mentions that environment variables should be expandable
So based on the above, everything seems like it should work, except it doesn’t.
Versions:
- Jenkins 2.60.3
- Github API plugin 1.86
- Github plugin 1.28.0
- Git plugin 3.5.1
- Credentials plugin 2.1.14
- Plain Credentials Plugin 1.4
- Github Pull Request Builder Plugin 1.39.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Jenkins Pull Request builder ignoring branches with ${sha1}
It appears, based on the refspec of +refs/pull/*:refs/remotes/origin/pr/* that you want this project to build pull requests only.
Read more >Single commit checkouts don't work - Jenkins Jira
I can't duplicate the problem you've described. I created a multi-configuration job in my test environment which successfully performs a checkout of a...
Read more >git-plugin fails to expand variables in refspec on initial clone
A sure way to trigger the bug is to enable both "Honor refspec on initial clone" and "Wipe out repository & force clone"....
Read more >Bug 487703 - Pack expansion in base specifier (Ia6e4626d) · Gerrit ...
Bug 487703 - Pack expansion in base specifier This adds support for the more general case, where the expansion pattern is not just...
Read more >Many different kinds of revision specifiers - GNOME Blogs
When a new commit is made on a branch, the branch just records the new revision. Tags simply record a single revision, much...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For the record, I had this same problem, which looks like this:
And worked around it by disabling “lightweight checkout” in the pipeline config.
@dylex Sometimes smallest things in life gives you Nirvana . Thanks a ton