This issue report is specifically about the git publisher within the git plugin. The git publisher is not available in Pipeline. The git publisher is available in Freestyle jobs.
- qbix, lightweight checkout is not available in Freestyle jobs
- jlpinardon git publisher does not perform a fetch and does not work with Pipelines
- dcarreira git publisher does not work with Pipelines
I'm unable to duplicate the issue as described. Steps I took while trying to duplicate the issue:
- Create a Freestyle job with a parameter, REPO_URL_FRAGMENT with choices MarkEWaite/jenkins-bugs, MarkEWaite/git-client-plugin, MarkEWaite/git-plugin, and MarkEWaite/platformlabeler-plugin
- Use git as the SCM in that Freestyle job from repository https://github.com//${REPO_URL}
- Checkout the master branch in that Freestyle job
- Enable the "Merge before build" git plugin extension with repository origin, branch master, and default settings for merge strategy and fast forward mode
- Add a conditional step to the Freestyle job that runs ant increment if the file build.xml is found in the workspace
- Enable Git Publisher as a Post-build Action, configured to push only if the build succeeds, merge the result to the branch master with remote named origin
When I perform those steps, the job runs successfully.
If I choose the REPO_URL_FRAGMENT value as MarkEWaite/jenkins-bugs, the job runs successfully, increments a build number, and pushes the change to the master branch of my jenkins-bugs repository.
If I choose the REPO_URL_FRAGMENT value as something other than MarkEWaite/jenkins-bugs, the job runs successfully, does not increment a build number, and does not push anything to the master branch of the selected repository.
See my job definition for the precise details JENKINS-27508-config.xml
There are also other form-fields where successfull variable-substitution would make sense.
For example I stumbled about the missing substitution-feature for the Path field of the Sparse Checkout path option.
However, variable-substitution works e.g. for the Local subdirectory for repo field of the Check out to a sub-directory option.
I would suggest this plugin supports (environment) variable-substitution in all form-fields.