[{"data":1,"prerenderedAt":540},["ShallowReactive",2],{"navigation_docs":3,"-platforms-github":80,"-platforms-github-surround":535},[4,56],{"title":5,"path":6,"stem":7,"children":8,"icon":55},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39,43,47,51],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Authentication","\u002Fguide\u002Fauth","1.guide\u002F02.auth",{"title":16,"path":17,"stem":18},"Repositories","\u002Fguide\u002Frepositories","1.guide\u002F03.repositories",{"title":20,"path":21,"stem":22},"Issues","\u002Fguide\u002Fissues","1.guide\u002F04.issues",{"title":24,"path":25,"stem":26},"Pull requests","\u002Fguide\u002Fpull-requests","1.guide\u002F05.pull-requests",{"title":28,"path":29,"stem":30},"Review threads","\u002Fguide\u002Fthreads","1.guide\u002F06.threads",{"title":32,"path":33,"stem":34},"Commits and CI","\u002Fguide\u002Fcommits","1.guide\u002F07.commits",{"title":36,"path":37,"stem":38},"Contribution templates","\u002Fguide\u002Ftemplates","1.guide\u002F08.templates",{"title":40,"path":41,"stem":42},"Code search","\u002Fguide\u002Fcode-search","1.guide\u002F09.code-search",{"title":44,"path":45,"stem":46},"Agents","\u002Fguide\u002Fagents","1.guide\u002F10.agents",{"title":48,"path":49,"stem":50},"Custom providers","\u002Fguide\u002Fcustom","1.guide\u002F11.custom",{"title":52,"path":53,"stem":54},"Explorer","\u002Fguide\u002Fexplorer","1.guide\u002F12.explorer","i-lucide-book-open",{"title":57,"path":58,"stem":59,"children":60,"icon":79},"Platforms","\u002Fplatforms","2.platforms\u002F0.index",[61,63,67,71,75],{"title":62,"path":58,"stem":59},"Overview",{"title":64,"path":65,"stem":66},"GitHub","\u002Fplatforms\u002Fgithub","2.platforms\u002F01.github",{"title":68,"path":69,"stem":70},"GitLab","\u002Fplatforms\u002Fgitlab","2.platforms\u002F02.gitlab",{"title":72,"path":73,"stem":74},"Gitea","\u002Fplatforms\u002Fgitea","2.platforms\u002F03.gitea",{"title":76,"path":77,"stem":78},"GitBucket","\u002Fplatforms\u002Fgitbucket","2.platforms\u002F04.gitbucket","i-lucide-library",{"id":81,"title":64,"body":82,"description":528,"extension":529,"links":530,"meta":531,"navigation":147,"path":65,"seo":533,"stem":66,"__hash__":534},"docs\u002F2.platforms\u002F01.github.md",{"type":83,"value":84,"toc":521},"minimark",[85,89,94,221,239,243,370,389,393,438,457,461,507,511,517],[86,87],"platform-facts",{"platform":88},"github",[90,91,93],"h2",{"id":92},"address-it","Address it",[95,96,101],"pre",{"className":97,"code":98,"language":99,"meta":100,"style":100},"language-ts shiki shiki-themes github-light github-light poimandres","import { createProvider } from \"@agntn\u002Fforges\";\n\nconst github = createProvider(\"github\"); \u002F\u002F GH_TOKEN, GITHUB_TOKEN, then gh auth token\nconst enterprise = createProvider(\"github\", { baseURL: \"https:\u002F\u002Fgithub.example.com\u002Fapi\u002Fv3\" });\n","ts","",[102,103,104,142,149,182],"code",{"__ignoreMap":100},[105,106,109,113,117,121,124,128,132,136,139],"span",{"class":107,"line":108},"line",1,[105,110,112],{"class":111},"sP0CR","import",[105,114,116],{"class":115},"sKlNE"," {",[105,118,120],{"class":119},"snHMy"," createProvider",[105,122,123],{"class":115}," }",[105,125,127],{"class":126},"stCPd"," from",[105,129,131],{"class":130},"scVjq"," \"",[105,133,135],{"class":134},"sQ7BG","@agntn\u002Fforges",[105,137,138],{"class":130},"\"",[105,140,141],{"class":115},";\n",[105,143,145],{"class":107,"line":144},2,[105,146,148],{"emptyLinePlaceholder":147},true,"\n",[105,150,152,156,160,163,166,169,171,173,175,178],{"class":107,"line":151},3,[105,153,155],{"class":154},"s1TYA","const",[105,157,159],{"class":158},"saoiD"," github",[105,161,162],{"class":154}," =",[105,164,120],{"class":165},"sULi6",[105,167,168],{"class":115},"(",[105,170,138],{"class":130},[105,172,88],{"class":134},[105,174,138],{"class":130},[105,176,177],{"class":115},"); ",[105,179,181],{"class":180},"sjhu3","\u002F\u002F GH_TOKEN, GITHUB_TOKEN, then gh auth token\n",[105,183,185,187,190,192,194,196,198,200,202,205,208,211,213,216,218],{"class":107,"line":184},4,[105,186,155],{"class":154},[105,188,189],{"class":158}," enterprise",[105,191,162],{"class":154},[105,193,120],{"class":165},[105,195,168],{"class":115},[105,197,138],{"class":130},[105,199,88],{"class":134},[105,201,138],{"class":130},[105,203,204],{"class":115},", {",[105,206,207],{"class":119}," baseURL",[105,209,210],{"class":115},":",[105,212,131],{"class":130},[105,214,215],{"class":134},"https:\u002F\u002Fgithub.example.com\u002Fapi\u002Fv3",[105,217,138],{"class":130},[105,219,220],{"class":115}," });\n",[222,223,224,227,228,231,232,235,236,238],"p",{},[102,225,226],{},"baseURL"," is taken as given, so spell out ",[102,229,230],{},"\u002Fapi\u002Fv3"," for Enterprise. The token chain asks ",[102,233,234],{},"gh"," for the host in ",[102,237,226],{},", not for github.com.",[90,240,242],{"id":241},"what-it-reads","What it reads",[244,245,246,259],"table",{},[247,248,249],"thead",{},[250,251,252,256],"tr",{},[253,254,255],"th",{},"Resource",[253,257,258],{},"Endpoint",[260,261,262,277,293,309,322,332,347,361],"tbody",{},[250,263,264,268],{},[265,266,267],"td",{},"repos",[265,269,270,273,274],{},[102,271,272],{},"GET \u002Frepos\u002F:owner\u002F:repo",", ",[102,275,276],{},"GET \u002Fusers\u002F:owner\u002Frepos",[250,278,279,282],{},[265,280,281],{},"issues",[265,283,284,273,287,273,290],{},[102,285,286],{},"GET \u002Frepos\u002F:owner\u002F:repo\u002Fissues",[102,288,289],{},"GET \u002Fsearch\u002Fissues",[102,291,292],{},"POST \u002Frepos\u002F:owner\u002F:repo\u002Fissues",[250,294,295,298],{},[265,296,297],{},"pull requests",[265,299,300,273,303,273,306],{},[102,301,302],{},"GET \u002Frepos\u002F:owner\u002F:repo\u002Fpulls",[102,304,305],{},"…\u002Fpulls\u002F:number\u002Ffiles",[102,307,308],{},"…\u002Fcommits\u002F:sha\u002Fcheck-runs",[250,310,311,314],{},[265,312,313],{},"commits",[265,315,316,273,319],{},[102,317,318],{},"GET \u002Frepos\u002F:owner\u002F:repo\u002Fcommits",[102,320,321],{},"…\u002Fcommits\u002F:sha",[250,323,324,327],{},[265,325,326],{},"CI runs",[265,328,329],{},[102,330,331],{},"GET \u002Frepos\u002F:owner\u002F:repo\u002Factions\u002Fruns",[250,333,334,337],{},[265,335,336],{},"threads",[265,338,339,340,343,344],{},"GraphQL ",[102,341,342],{},"reviewThreads",", REST ",[102,345,346],{},"POST …\u002Fpulls\u002F:number\u002Fcomments\u002F:id\u002Freplies",[250,348,349,352],{},[265,350,351],{},"templates",[265,353,354,357,358],{},[102,355,356],{},"GET \u002Frepos\u002F:owner\u002F:repo\u002Fcontents\u002F.github\u002F…",", then ",[102,359,360],{},":owner\u002F.github",[250,362,363,365],{},[265,364,102],{},[265,366,367],{},[102,368,369],{},"GET \u002Fsearch\u002Fcode",[222,371,372,373,376,377,380,381,384,385,388],{},"Pagination reads the ",[102,374,375],{},"Link"," header. ",[102,378,379],{},"nextPage"," is the ",[102,382,383],{},"page"," of its ",[102,386,387],{},"rel=\"next\"",".",[90,390,392],{"id":391},"what-comes-back","What comes back",[222,394,395,398,399,273,402,398,405,408,409,398,412,415,416,419,420,423,424,427,428,430,431,423,434,437],{},[102,396,397],{},"Repository.parent"," from ",[102,400,401],{},"parent",[102,403,404],{},"viewerPermission",[102,406,407],{},"permissions"," when the token has any. ",[102,410,411],{},"Issue",[102,413,414],{},"\u002Fissues"," with pull requests filtered out by the missing ",[102,417,418],{},"pull_request"," key. ",[102,421,422],{},"PullRequest.mergeable"," is ",[102,425,426],{},"null"," while GitHub is still computing it, which it does lazily, so the first read after a push often says ",[102,429,426],{},". ",[102,432,433],{},"Commit.filesComplete",[102,435,436],{},"true"," when GitHub confirms a complete file list, collected up to its cap of 3 000 files.",[222,439,440,441,444,445,448,449,452,453,456],{},"Templates: repository files first, then the owner's ",[102,442,443],{},".github"," repository with ",[102,446,447],{},"scope: \"owner\""," and ",[102,450,451],{},"inherited: true",". Issue and pull request overrides resolve on their own. A host without the ",[102,454,455],{},"x-github-enterprise-version"," header that is not github.com is treated as repository scope only.",[90,458,460],{"id":459},"gotchas","Gotchas",[462,463,464,468,482,493,500],"ul",{},[465,466,467],"li",{},"Review threads need a token. GraphQL has no anonymous access and REST has no resolved flag, so there is no anonymous thread list to be had.",[465,469,470,471,474,475,478,479,388],{},"Anonymous reads share sixty requests an hour per address. A 403 with a rate limit header is a ",[102,472,473],{},"RateLimitError"," with ",[102,476,477],{},"retryAfter",", not a ",[102,480,481],{},"PermissionError",[465,483,484,486,487,490,491,388],{},[102,485,414],{}," returns pull requests too. Filtered out here. Search returns both, and ",[102,488,489],{},"pullRequests.search"," keeps the ones with ",[102,492,418],{},[465,494,495,496,499],{},"Code search: ",[102,497,498],{},"incomplete"," goes true on a search timeout, when scope enforcement drops a stray row, or past the cap of 1 000 results.",[465,501,502,503,506],{},"Issue search keeps GitHub's qualifier syntax. ",[102,504,505],{},"label:bug is:open"," works here and is plain text on GitLab and Gitea.",[90,508,510],{"id":509},"where-it-lives","Where it lives",[222,512,513,516],{},[102,514,515],{},"src\u002Fproviders\u002Fgithub.ts",". Also the template for a new provider. Copy it, do not start from scratch.",[518,519,520],"style",{},"html pre.shiki code .sP0CR, html code.shiki .sP0CR{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7}html pre.shiki code .sKlNE, html code.shiki .sKlNE{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#A6ACCD}html pre.shiki code .snHMy, html code.shiki .snHMy{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#ADD7FF}html pre.shiki code .stCPd, html code.shiki .stCPd{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#A6ACCD}html pre.shiki code .scVjq, html code.shiki .scVjq{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#A6ACCD}html pre.shiki code .sQ7BG, html code.shiki .sQ7BG{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#5DE4C7}html pre.shiki code .s1TYA, html code.shiki .s1TYA{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#91B4D5}html pre.shiki code .saoiD, html code.shiki .saoiD{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#E4F0FB}html pre.shiki code .sULi6, html code.shiki .sULi6{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#E4F0FBD0}html pre.shiki code .sjhu3, html code.shiki .sjhu3{--shiki-light:#6A737D;--shiki-light-font-style:inherit;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#767C9DB0;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":100,"searchDepth":144,"depth":144,"links":522},[523,524,525,526,527],{"id":92,"depth":144,"text":93},{"id":241,"depth":144,"text":242},{"id":391,"depth":144,"text":392},{"id":459,"depth":144,"text":460},{"id":509,"depth":144,"text":510},"REST v3 for everything except review threads, which need GraphQL for their resolved flag. GitHub Enterprise works through baseURL.","md",null,{"icon":532},"i-simple-icons-github",{"title":64,"description":528},"sQYsIQQBsR8dy_0NPbIWIFFSSmUOQPV9VYVYsF9ifTI",[536,538],{"title":62,"path":58,"stem":59,"description":537,"children":-1},"Three provider classes, four platforms. Pick one to see its auth, its endpoints, what it maps and the traps.",{"title":68,"path":69,"stem":70,"description":539,"children":-1},"API v4 with Private-Token auth, project ids resolved and cached for you, iid as the number, and a group fallback for owners that are not users.",1788525966686]