{"action":"created","issue":{"url":"https://api.github.com/repos/jtarchie/github-pullrequest-resource/issues/200","repository_url":"https://api.github.com/repos/jtarchie/github-pullrequest-resource","labels_url":"https://api.github.com/repos/jtarchie/github-pullrequest-resource/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/jtarchie/github-pullrequest-resource/issues/200/comments","events_url":"https://api.github.com/repos/jtarchie/github-pullrequest-resource/issues/200/events","html_url":"https://github.com/jtarchie/github-pullrequest-resource/issues/200","id":346260275,"node_id":"MDU6SXNzdWUzNDYyNjAyNzU=","number":200,"title":"Impossible to fetch from private repository with ssh","user":{"login":"Fi3","id":6207037,"node_id":"MDQ6VXNlcjYyMDcwMzc=","avatar_url":"https://avatars2.githubusercontent.com/u/6207037?v=4","gravatar_id":"","url":"https://api.github.com/users/Fi3","html_url":"https://github.com/Fi3","followers_url":"https://api.github.com/users/Fi3/followers","following_url":"https://api.github.com/users/Fi3/following{/other_user}","gists_url":"https://api.github.com/users/Fi3/gists{/gist_id}","starred_url":"https://api.github.com/users/Fi3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fi3/subscriptions","organizations_url":"https://api.github.com/users/Fi3/orgs","repos_url":"https://api.github.com/users/Fi3/repos","events_url":"https://api.github.com/users/Fi3/events{/privacy}","received_events_url":"https://api.github.com/users/Fi3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-31T16:17:48Z","updated_at":"2018-08-01T14:37:26Z","closed_at":null,"author_association":"NONE","body":"**Describe the bug**\r\ngithub-pullrequest-resource can not read from remote repository when repository is private.\r\n\r\nThe below pipeline without `rsources[0].source.uri` and `rsources[0].source.private_key` and with `fi3/prova-pr-councurse` set as public work as expected. If I do a PR against master it run `test.sh` just an `ls` that return `0` and it check the PR as good. But as soon as I make the rep private and I add a deploy key  to the rep set with read/write permission, the plugin complain that can not read from the remote rep. I tried the private key that I'm passing to the plugin with `git clone` and it works.\r\n\r\nI'm sorry if I'm missing something obvious, is the first time that I work with councurse :)\r\n\r\n**To Reproduce**\r\n```\r\n---\r\nresource_types:\r\n  - name: pull-request\r\n    type: docker-image\r\n    source:\r\n      repository: jtarchie/pr\r\n\r\nresources:\r\n  - name: pull-req\r\n    type: pull-request\r\n    source:\r\n      repo: fi3/prova-pr-councurse\r\n      uri: git@github.com:Fi3/prova-pr-councurse.git\r\n      base: master\r\n      access_token: ...\r\n      private_key: |-\r\n          -----BEGIN RSA PRIVATE KEY-----\r\n          ....\r\n          -----END RSA PRIVATE KEY-----\r\n\r\njobs:\r\n - name: pr tests\r\n   plan:\r\n   - get: pull-req\r\n     trigger: true\r\n     version: every\r\n   - task: rspec\r\n     privileged: true\r\n     config:\r\n       image_resource:\r\n         type: docker-image\r\n         source:\r\n           repository: jtarchie/pr\r\n       inputs:\r\n         - name: pull-req\r\n       platform: linux\r\n       run:\r\n         path: ./pull-req/test.sh\r\n         args: []\r\n     on_success:\r\n       put: pull-req\r\n       params:\r\n         path: pull-req\r\n         status: success\r\n     on_failure:\r\n       put: pull-req\r\n       params:\r\n         path: pull-req\r\n         status: failure\r\n```\r\n\r\n**Expected behavior**\r\nNo error when `rspec` is executed\r\n\r\n**Error**\r\n```\r\nIdentity added: /tmp/git-resource-private-key (/tmp/git-resource-private-key)\r\nCloning into '/tmp/build/get'...\r\nfatal: Could not read from remote repository.\r\n\r\nPlease make sure you have the correct access rights\r\nand the repository exists.\r\n/opt/resource/lib/commands/in.rb:27:in `output': git clone failed (RuntimeError)\r\n\tfrom /opt/resource/lib/commands/in.rb:110:in `<main>'\r\n```"},"comment":{"url":"https://api.github.com/repos/jtarchie/github-pullrequest-resource/issues/comments/409597804","html_url":"https://github.com/jtarchie/github-pullrequest-resource/issues/200#issuecomment-409597804","issue_url":"https://api.github.com/repos/jtarchie/github-pullrequest-resource/issues/200","id":409597804,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTU5NzgwNA==","user":{"login":"Fi3","id":6207037,"node_id":"MDQ6VXNlcjYyMDcwMzc=","avatar_url":"https://avatars2.githubusercontent.com/u/6207037?v=4","gravatar_id":"","url":"https://api.github.com/users/Fi3","html_url":"https://github.com/Fi3","followers_url":"https://api.github.com/users/Fi3/followers","following_url":"https://api.github.com/users/Fi3/following{/other_user}","gists_url":"https://api.github.com/users/Fi3/gists{/gist_id}","starred_url":"https://api.github.com/users/Fi3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fi3/subscriptions","organizations_url":"https://api.github.com/users/Fi3/orgs","repos_url":"https://api.github.com/users/Fi3/repos","events_url":"https://api.github.com/users/Fi3/events{/privacy}","received_events_url":"https://api.github.com/users/Fi3/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T14:37:26Z","updated_at":"2018-08-01T14:37:26Z","author_association":"NONE","body":"I confirm  that both the `-` after `|`  and the leading white spaces are not a problem. I tried to change the keys and now it works (in my own defense :-D i had to say that I already tried it but probably I copied the wrong key 2 times)"}}
{"actor":{"display_login":"Fi3"}}