gocd-build-github-pull-requests
gocd-build-github-pull-requests copied to clipboard
Plugin fails after removal of master branch
I branched master
to main
some time ago and set this as the default branch on our repos, today I deleted the master
branch but this has caused an error on our build pipeline:
Interaction with plugin with id 'github.pr' implementing 'scm' extension failed while requesting for 'checkout'.
Reason: [The plugin sent a response that could not be understood by Go.
Plugin returned with code '500' and the following response:
'"Exception (Process exited with an error: 128 (Exit value: 128))
Occurred: [git, clone, --branch\u003dmaster, [email protected]:myorg/myrepo.git, /var/lib/go-agent-2/pipelines/build.pr] - null"']
Is there a configuration/env vars I need to update? I have restored master
for now.
v1.3.4 GoCD Version: 19.2.0
I am also seeing this response periodically
Interaction with plugin with id 'github.pr' implementing 'scm' extension failed while requesting for 'checkout'.
Reason: [The plugin sent a response that could not be understood by Go.
Plugin returned with code '500' and the following response: '"Exception (Process exited with an error: 1 (Exit value: 1)) Occurred: [git, checkout, -f, master] - /var/lib/go-agent-2/pipelines/build.pr"']
This is slowly becoming a blocker for us - since new GitHub repositories have the main
as the default branch and not all people (who can create new repos) have an easy way or permission to change the default repo back to master
to make their GoCD pipelines work with this plugin.
@ashwanthkumar could we please get an update and some timeframe when you or someone could have a look at this issue?
@paullewisn @mirogta I believe the alternative is just to set the Default branch on the Github plugin dialog to main
rather than leaving it empty.
It you still get an issue with it trying to checkout main
you will probably need to change the case of one of the characters in the Repository Url in Go to get it to sort its self out
an update on this for anyone still using this - setting defaultBranch
instead of branch
under the plugin options in yaml allows specifying main
.
https://github.com/ashwanthkumar/gocd-build-github-pull-requests/blob/cc805eaa642b857cd3fc23ec255a925179430b90/src/main/java/in/ashwanthkumar/gocd/github/GitHubPRBuildPlugin.java#L392-L401
my-PR:
plugin_configuration:
id: github.pr
version: 1
options:
url: [email protected]:my-org/my-repo.git
defaultBranch: main