tag:help.appveyor.com,2012-11-13:/discussions/questions/935-is-it-possible-to-add-forks-to-the-projectsAppVeyor: Discussion 2018-10-19T08:16:59Ztag:help.appveyor.com,2012-11-13:Comment/359443732015-02-03T04:01:16Z2015-02-03T04:01:16ZIs it possible to add FORKS to the 'projects'?<div><p>You can do a simple Web API app (and host it on Azure Websites
for free) listening for "Fork" event from GitHub webhook and then
using AppVeyor API to add new projects for those forks (here YAML
comes).</p>
<p>When calling AppVeyor create project API (<a href=
"http://www.appveyor.com/docs/api/projects-builds#add-project">http://www.appveyor.com/docs/api/projects-builds#add-project</a>)
you can specify {owner}/{repo} to any GitHub repo. Of course, you
should have rights there to add webhooks and SSH keys.</p>
<p>Hope that helps.</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/359443732015-02-03T04:24:54Z2015-02-03T04:24:54ZIs it possible to add FORKS to the 'projects'?<div><p>Hm. ok - sounds complex, heavy and a bit confusing.</p>
<p>Lets try using the API as u suggested.<br></p>
<pre>
<code>POST /api/projects HTTP/1.1
Host: ci.appveyor.com
Authorization: Bearer <snip>
Cache-Control: no-cache
Postman-Token: 5c99e0da-5325-15c2-7c3c-cfc40065028f<br><br>
<br>{
"repositoryProvider":"gitHub",
"repositoryName":"my-collegue/XWing"
}</code>
</pre>
<p><code>{"message":"Processing of the HTTP request resulted in an
exception. Please see the HTTP response returned by the 'Response'
property of this exception for details."}</code></p>
<p>(i couldn't find any more info).</p>
<p>So what I'm assuming is this -> hitting the api, it will<br>
- use the Token provided and find my account. - Grab my oauth
secret sauce stuff from my account because i've already done the
oauth permissions thingy in AV. - create a new project for the
provided git repo link.</p>
<p>because that GH repo is private BUT you're using my oauth secret
token and stuff, it should download ok, right?</p>
<p>Is that the general gist?</p></div>Pure Krometag:help.appveyor.com,2012-11-13:Comment/359443732015-02-03T05:10:26Z2015-02-03T05:10:26ZIs it possible to add FORKS to the 'projects'?<div><p>Yeah, that's correct. Don't forget to add
<code>Content-type</code> header with <code>application/json</code>
in it.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/359443732015-02-03T05:19:14Z2015-02-03T05:19:14ZIs it possible to add FORKS to the 'projects'?<div><p>AH! Worked!!!</p>
<p>I didn't add that because of this:</p>
<p><img alt="" src="http://i.imgur.com/2H1YdZl.png"></p>
<p>i <em>assumed</em> it didn't need it because it's say's
<em><em>it's default</em></em></p>
<p>Ok - great - i'm in business again...</p>
<p>So now .. could I create an issue to make this an option in the
<code>Add Project</code> section of the site? eg...</p>
<p><img alt="" src="http://i.imgur.com/8l2OZIr.png"></p>
<p>Would be -really- helpful :)</p></div>Pure Krometag:help.appveyor.com,2012-11-13:Comment/359443732015-02-03T05:25:44Z2015-02-03T05:25:44ZIs it possible to add FORKS to the 'projects'?<div><p>Sure. If you are on Postman right now could you check if that
API (with preview header) <a href=
"https://developer.github.com/v3/repos/#list-your-repositories">https://developer.github.com/v3/repos/#list-your-repositories</a>
will return all repos for your account that you have access to.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/359443732015-02-03T05:40:01Z2015-02-03T05:40:01ZIs it possible to add FORKS to the 'projects'?<div><p>Ok - <a href="https://github.com/appveyor/ci/issues/136">Issue
#136 created</a> :)</p>
<p>Using postman, i tried to list my repo's and my private one
isn't there :/</p>
<p>I did fork my private one from another org .. and it has some
notice about other orgs and stuff and using another endpoint,
etc.</p></div>Pure Krometag:help.appveyor.com,2012-11-13:Comment/359443732015-02-03T18:00:19Z2015-02-03T18:00:19ZIs it possible to add FORKS to the 'projects'?<div><p>Have you added "magic"
<code>application/vnd.github.moondragon+json</code> accept
header?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/359443732015-02-09T03:12:29Z2015-02-09T03:12:29ZIs it possible to add FORKS to the 'projects'?<div><p>Nope - I didn't try that.</p>
<p>On a side note: I didn't notice that you can any <em>any</em>
git repo!</p>
<p>So i just used that option:</p>
<p>git repo => my private fork<br>
credentials: repository authentication<br>
username: whatever;<br>
password: whatever</p>
<p>and that worked :) simple!!!</p></div>Pure Krome