ashwanthkumar / gocd-build-github-pull-requests

GoCD plugin to build PRs for a Github repo
95 stars 72 forks source link

v1.3.5 PR environment variables not set #150

Closed atharvai closed 4 years ago

atharvai commented 4 years ago

plugin_version: v1.3.5

I have a PR open and running a GoCD Pipeline on the any commit doesn't set the PR environment variables. I'm looking to use GO_SCM_*_PR_BRANCH and GO_SCM_*_TARGET_BRANCH but I can only find GO_SCM_*_PR_ID set.

Is there any additional setup to do or is there a bug?

atharvai commented 4 years ago

I had a look at this comment but it doesn't apply as I'm using SSH and not HTTPS. The Plugin is able to post the status back to Github correctly, so I assume it has access to PR data.

ashwanthkumar commented 4 years ago

These lines should populate all the relevant details about the PR. Can you please check the logs for any relevant exceptions that might have been hit because of this?

atharvai commented 4 years ago

@ashwanthkumar thanks. We had a look and we don't have .github file with credentials. I don't think that is a viable option for us as it means committing secret credentials to git. Is there another mechanism for the plugin to use? or a workaround for GoCD to use Secure Variables?

ashwanthkumar commented 4 years ago

@atharvai The .github file is not supposed to be checked into any repo. It needs to be present on the GoCD Server machine (under home directory of go user to be precise). More details on this on the README. Unless folks have SSH access to the server, which defeats the gocd secure variables as well, it should work for most secure environments.

Having said that, this plugin is one of the oldest out there. We could probably use the Plugin settings now to persist the login name and OAuth Token along with other settings. Can you please file an issue for it -- either me, you or someone else can pick it up when we've time for it.

atharvai commented 4 years ago

got it. tried and successful.

Thanks for your help