tag:help.appveyor.com,2012-11-13:/discussions/problems/2126-cant-create-project-from-github-private-repositoryAppVeyor: Discussion 2018-08-25T02:17:56Ztag:help.appveyor.com,2012-11-13:Comment/368185052015-05-12T21:01:31Z2015-05-12T21:01:31ZCan't create project from GitHub private repository<div><p>Re-authorize GitHub for "private and public" repositories on
<a href="https://ci.appveyor.com/account">https://ci.appveyor.com/account</a>
page</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368185052015-05-12T21:05:22Z2015-05-12T21:05:22ZCan't create project from GitHub private repository<div><p>Worked like a charm, thank you!</p></div>lairtag:help.appveyor.com,2012-11-13:Comment/368185052015-05-12T21:06:54Z2015-05-12T21:06:54ZCan't create project from GitHub private repository<div><p>Actually, not quite (sorry).</p>
<p>Now I see the repo in the list, but when I click "Add" I get the
following error message: "Error adding SSH key to GitHub
repository: Response status code does not indicate success: 404
(Not Found)."</p></div>lairtag:help.appveyor.com,2012-11-13:Comment/368185052015-05-12T21:18:18Z2015-05-12T21:18:18ZCan't create project from GitHub private repository<div><p>There is not enough permissions to add SSH key to that repo.
Usually, being collaborator is not enough for that (collaborator
works with code only), but you should be an admin.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368185052015-05-13T10:06:54Z2015-05-13T10:37:13ZCan't create project from GitHub private repository<div><p>Unfortunately, repository I am trying to add build to is a user
repository, not an organization one, so I cannot be made an admin
there (without transferring ownership).</p>
<p>I'll outline the situation again:</p>
<ul>
<li>the repo is private, personal and owned by user A</li>
<li>I am collaborator on this repo</li>
<li>A trusts me well enough, but there's no possibility to
designate me as "co-admin" of personal repo on GitHub</li>
<li>I'd like to set up a private build for the repository</li>
<li>user A has no enough time to set up the build himself</li>
</ul>
<p>What are our options?<br>
Is there any way the we can manually set up the relationship
between GitHub and AppVeyor?<br>
What would we lose if we set it up as "plain Git"?</p></div>lairtag:help.appveyor.com,2012-11-13:Comment/368185052015-05-13T16:41:03Z2015-05-13T16:41:03ZCan't create project from GitHub private repository<div><p>"Git" and "GitHub" webhook formats might be non-compatible, but
you can give it a try for sure.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368185052015-05-14T11:00:27Z2015-05-14T11:00:27ZCan't create project from GitHub private repository<div><p>It mostly works. There's no problem with manual builds (so the
SSH access works just fine), but there are some with CI.</p>
<p>If we use a GitHub-flavored webhook URL
(<code>https://ci.appveyor.com/api/github/webhook?id=***</code>),
it does not accept an event with following message: <code>Push
request and project repositories do not match.</code>.</p>
<p>If we use a normal URL
(<code>https://ci.appveyor.com/api/git/webhook?id=***</code>), our
events are accepted just fine, but they always trigger a build from
<code>master</code>, regardless of which branch the commit was
pushed to.</p>
<p>Here's the example of an event:</p>
<p>Headers:</p>
<pre>
<code>Request URL: https://ci.appveyor.com/api/git/webhook?id=njo1lo58n1vpgteo
Request method: POST
content-type: application/x-www-form-urlencoded
Expect:
User-Agent: GitHub-Hookshot/6a28ed9
X-GitHub-Delivery: f5089980-fa1b-11e4-87b0-d9c84e6a670c
X-GitHub-Event: push</code>
</pre>
<p>Body:</p>
<pre>
<code>{
"ref": "refs/heads/feature-automatic-doc-generation",
"before": "4866afffada160e645081ae1b1c5b98436b8d715",
"after": "aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
"created": false,
"deleted": false,
"forced": false,
"base_ref": null,
"compare": "https://github.com/***/compare/4866afffada1...aabe6ed0e4cf",
"commits": [
{
"id": "aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
"distinct": true,
"message": "Just another AppVeyor test on another branch",
"timestamp": "2015-05-14T12:30:51+03:00",
"url": "https://github.com/***/commit/aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
"author": {
"name": "Serg Rogovtsev",
"email": "***",
"username": "srogovtsev"
},
"committer": {
"name": "Serg Rogovtsev",
"email": "***",
"username": "srogovtsev"
},
"added": [
"eee"
],
"removed": [
],
"modified": [
]
}
],
"head_commit": {
"id": "aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
"distinct": true,
"message": "Just another AppVeyor test on another branch",
"timestamp": "2015-05-14T12:30:51+03:00",
"url": "https://github.com/***/commit/aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
"author": {
"name": "Serg Rogovtsev",
"email": "***",
"username": "srogovtsev"
},
"committer": {
"name": "Serg Rogovtsev",
"email": "***",
"username": "srogovtsev"
},
"added": [
"eee"
],
"removed": [
],
"modified": [
]
},
"repository": {
"id": 33789552,
"name": "***",
"full_name": "***",
"owner": {
"name": "***",
"email": "***"
},
"private": true,
"html_url": "https://github.com/***",
"description": "REST API",
"fork": false,
"url": "https://github.com/***",
"forks_url": "https://api.github.com/repos/***/forks",
"keys_url": "https://api.github.com/repos/***/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/***/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/***/teams",
"hooks_url": "https://api.github.com/repos/***/hooks",
"issue_events_url": "https://api.github.com/repos/***/issues/events{/number}",
"events_url": "https://api.github.com/repos/***/events",
"assignees_url": "https://api.github.com/repos/***/assignees{/user}",
"branches_url": "https://api.github.com/repos/***/branches{/branch}",
"tags_url": "https://api.github.com/repos/***/tags",
"blobs_url": "https://api.github.com/repos/***/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/***/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/***/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/***/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/***/statuses/{sha}",
"languages_url": "https://api.github.com/repos/***/languages",
"stargazers_url": "https://api.github.com/repos/***/stargazers",
"contributors_url": "https://api.github.com/repos/***/contributors",
"subscribers_url": "https://api.github.com/repos/***/subscribers",
"subscription_url": "https://api.github.com/repos/***/subscription",
"commits_url": "https://api.github.com/repos/***/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/***/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/***/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/***/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/***/contents/{+path}",
"compare_url": "https://api.github.com/repos/***/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/***/merges",
"archive_url": "https://api.github.com/repos/***/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/***/downloads",
"issues_url": "https://api.github.com/repos/***/issues{/number}",
"pulls_url": "https://api.github.com/repos/***/pulls{/number}",
"milestones_url": "https://api.github.com/repos/***/milestones{/number}",
"notifications_url": "https://api.github.com/repos/***/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/***/labels{/name}",
"releases_url": "https://api.github.com/repos/***/releases{/id}",
"created_at": 1428781099,
"updated_at": "2015-05-10T09:48:44Z",
"pushed_at": 1431595871,
"git_url": "git://github.com/***.git",
"ssh_url": "git@github.com:***.git",
"clone_url": "https://github.com/***.git",
"svn_url": "https://github.com/***",
"homepage": null,
"size": 96,
"stargazers_count": 0,
"watchers_count": 0,
"language": "C#",
"has_issues": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 3,
"forks": 0,
"open_issues": 3,
"watchers": 0,
"default_branch": "master",
"stargazers": 0,
"master_branch": "master"
},
"pusher": {
"name": "srogovtsev",
"email": "***"
},
"sender": {
"login": "srogovtsev",
"id": 2332517,
"avatar_url": "https://avatars.githubusercontent.com/u/2332517?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/srogovtsev",
"html_url": "https://github.com/srogovtsev",
"followers_url": "https://api.github.com/users/srogovtsev/followers",
"following_url": "https://api.github.com/users/srogovtsev/following{/other_user}",
"gists_url": "https://api.github.com/users/srogovtsev/gists{/gist_id}",
"starred_url": "https://api.github.com/users/srogovtsev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/srogovtsev/subscriptions",
"organizations_url": "https://api.github.com/users/srogovtsev/orgs",
"repos_url": "https://api.github.com/users/srogovtsev/repos",
"events_url": "https://api.github.com/users/srogovtsev/events{/privacy}",
"received_events_url": "https://api.github.com/users/srogovtsev/received_events",
"type": "User",
"site_admin": false
}
}</code>
</pre></div>lairtag:help.appveyor.com,2012-11-13:Comment/368185052015-05-14T20:42:33Z2015-05-14T20:42:33ZCan't create project from GitHub private repository<div><p>OK, thanks for the update.</p>
<p>So, we might have at least two options here:</p>
<p>1) Ignore error and continue adding a new project if SSH key
cannot be added to repo. This is like its done with webhooks now
though having broken build right aways doesn't look good.</p>
<p>2) Improve repository name validation by recognizing standard
GitHub URLs (if provider is generic Git).</p>
<p>My preferred choice would be #2</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368185052015-05-14T21:06:22Z2015-05-14T21:06:22ZCan't create project from GitHub private repository<div><p>I think that actually you could implement both scenarios.</p>
<p>The first one would be "Error adding SSH key, click "OK" if you
ready to configure repository yourself, here's your key, here's
your webhook url". That will allow for all the GitHub-related bonus
options (skipping tags, so on).</p>
<p>And the second one is just as you described, improving
repository name validation in webhooks.</p>
<p>Thanks for your understanding!</p></div>lairtag:help.appveyor.com,2012-11-13:Comment/368185052015-05-17T18:11:04Z2015-05-17T18:11:04ZCan't create project from GitHub private repository<div><p>For example of first one, you can take a look at Slack: <a href="https://slack.zendesk.com/hc/en-us/articles/201710957-How-do-I-use-the-GitHub-integration-with-GitHub-Enterprise-">
https://slack.zendesk.com/hc/en-us/articles/201710957-How-do-I-use-...</a></p>
<p>They call it "unauthed integration", and it's pretty easy to
setup. Basically it's just a webhook url + settings.</p></div>lairtag:help.appveyor.com,2012-11-13:Comment/368185052017-04-07T18:10:16Z2017-04-07T18:10:16ZCan't create project from GitHub private repository<div><p>Update: workaround with calling <code>GitHub</code> or <code>BitBucket</code> projects with <code>Git</code> webhook will not work anymore. It is blocked as part of security hardening.</p>
<p>If someone uses this approach and broken now, target project should be re-created as a <code>Git</code> project in AppVeyor. If project re-creation is problematic, please let us know and we can change project repository type to <code>Git</code> manually in backed system.</p>
<p>Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/368185052017-06-16T08:39:51Z2017-06-16T08:39:55ZCan't create project from GitHub private repository<div><p>Dear Feodor,</p>
<p>I have the same case<br>
(I am granted a contributor access to a private GitHub repository of another user. I'd like to set up CI builds and deployment for it, but I don't see it in New Project/Select Repository/GitHub list.) Only difference is that I am a contributor of an organization not of a user.</p>
<p>I have re-authorized Github as you suggested but I still cannot see this repository in the list. I see only my personal public repository.</p>
<p>What else can I do to see the required repo?</p>
<p>Thanks.</p></div>Michaeltag:help.appveyor.com,2012-11-13:Comment/368185052017-06-16T21:46:58Z2017-06-16T21:46:58ZCan't create project from GitHub private repository<div><p>Go to <a href="https://github.com/settings/applications">https://github.com/settings/applications</a>, then click "AppVeyor CI" link and make sure AppVeyor access is allowed to the organization owning the repo.</p></div>Feodor Fitsner