github-pullrequest-resource icon indicating copy to clipboard operation
github-pullrequest-resource copied to clipboard

Github Enterprise URL and Username error

Open NickLarsenNZ opened this issue 6 years ago • 0 comments

Describe the bug If I set the api_endpoint to https://github.internal/api/v3/, I can detect PRs, however when I try to set the status in a job, I get the following error in the get:

Cloning into '/tmp/build/get'...
fatal: could not read Username for 'https://github.com': No such device or address
/opt/resource/lib/commands/in.rb:27:in `output': git clone failed (RuntimeError)
	from /opt/resource/lib/commands/in.rb:110:in `<main>'

So then I also set the uri to https://github.internal/MYORG/my-repo, and receive the following error in the put:

/opt/resource/lib/commands/out.rb:97:in `block in whitelist': undefined method `gsub!' for nil:NilClass (NoMethodError)
	from /opt/resource/lib/commands/out.rb:96:in `each'
	from /opt/resource/lib/commands/out.rb:96:in `whitelist'
	from /opt/resource/lib/commands/out.rb:55:in `block in output'
	from /opt/resource/lib/commands/out.rb:52:in `each'
	from /opt/resource/lib/commands/out.rb:52:in `output'
	from /opt/resource/lib/commands/out.rb:117:in `<main>'

To Reproduce My type and resource configuration:

- name: pull-request
  type: docker-image
  source:
    repository: jtarchie/pr

resources:
- name: pull-request-source
  type: pull-request
  source:
    access_token: ((github-token))
    username: git
    password: ((github-token))
    uri: https://((github-host))/((github-org))/((github-repo))
    api_endpoint: https://((github-host))/api/v3/
    repo: ((github-org))/((github-repo))
    base: ((branch))
    only_mergeable: true

Expected behavior I expect to be able to use either Github.com or Github Enterprise for the same configuration if possible, otherwise perhaps clear documentation on what exactly to set when using GitHub Enterprise. (I'm happy to submit a documentation PR)

NickLarsenNZ avatar Oct 04 '18 20:10 NickLarsenNZ