[{"data":1,"prerenderedAt":891,"buildId":892},["ShallowReactive",2],{"docs:\u002Fintegrations\u002Fgithub-actions":3},{"page":4,"section":16,"document":17,"credits":10,"prev":883,"next":887},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"github-actions","\u002Fintegrations\u002Fgithub-actions","integrations\u002Fgithub-actions.md","GitHub Actions","How readerly detects GitHub Actions, prints text with file annotations on stderr, escapes them, caps them at 10, and what agents in CI get instead.",null,[],"i-simple-icons-githubactions","article",true,2,"integrations",{"nodes":18,"toc":877},[19,32,40,83,90,194,230,236,254,319,330,333,352,359,365,390,603,606,615,689,695,698,831,839,845],[20,21,22,23,27,28,31],"p",{},"On GitHub Actions, a readerly command prints the ",[24,25,26],"code",{},"text"," report without color or prompts, and writes workflow commands on stderr so the pull request marks the lines. ",[24,29,30],{},"createOut"," does this when it detects the runner. You call nothing.",[33,34,39],"h2",{"id":35,"anchor":36},"detection",{"label":37,"icon":38},"Section titled \"Detection\"","#","Detection",[20,41,42,45,46,49,50,53,54,57,58,61,62,65,66,65,69,72,73,76,77,82],{},[24,43,44],{},"detect()"," reads ",[24,47,48],{},"GITHUB_ACTIONS"," from the environment and returns ",[24,51,52],{},"reader: \"ci\""," with ",[24,55,56],{},"ci: { name: \"github-actions\" }",". The runner sets the variable on every job. A ",[24,59,60],{},"CI"," set to ",[24,63,64],{},"0",", ",[24,67,68],{},"false",[24,70,71],{},"no"," or ",[24,74,75],{},"off"," turns CI detection off, see the ",[78,79,81],"a",{"href":80},"\u002Fguide\u002Freaders","CI table",".",[20,84,85,86,89],{},"The profile for that run, from ",[24,87,88],{},"resolveProfile"," with no flags:",[91,92,93,111],"table",{},[94,95,96],"thead",{},[97,98,99,103,106],"tr",{},[100,101,102],"th",{},"Field",[100,104,105],{},"Value",[100,107,108],{},[24,109,110],{},"profile.why",[112,113,114,131,147,163,180],"tbody",{},[97,115,116,122,126],{},[117,118,119],"td",{},[24,120,121],{},"format",[117,123,124],{},[24,125,26],{},[117,127,128],{},[24,129,130],{},"detected ci (CI:github-actions)",[97,132,133,138,142],{},[117,134,135],{},[24,136,137],{},"color",[117,139,140],{},[24,141,68],{},[117,143,144],{},[24,145,146],{},"stdout is not a TTY",[97,148,149,154,158],{},[117,150,151],{},[24,152,153],{},"interactive",[117,155,156],{},[24,157,68],{},[117,159,160],{},[24,161,162],{},"reader is ci",[97,164,165,170,175],{},[117,166,167],{},[24,168,169],{},"budget",[117,171,172],{},[24,173,174],{},"Infinity",[117,176,177],{},[24,178,179],{},"no budget for ci on text",[97,181,182,187,192],{},[117,183,184],{},[24,185,186],{},"annotations",[117,188,189],{},[24,190,191],{},"\"github\"",[117,193],{},[20,195,196,199,200,202,203,206,207,209,210,212,213,65,216,219,220,223,224,226,227,82],{},[24,197,198],{},"profile.annotations"," is ",[24,201,191],{}," only when the reader is ",[24,204,205],{},"ci",", the provider is ",[24,208,5],{}," and the format is ",[24,211,26],{},". ",[24,214,215],{},"--format json",[24,217,218],{},"--format jsonl"," and ",[24,221,222],{},"--json"," turn annotations off. Annotations are a side channel next to ",[24,225,26],{},", not a ",[78,228,121],{"href":229},"\u002Fguide\u002Fformats",[33,231,235],{"id":232,"anchor":233},"what-the-runner-prints",{"label":234,"icon":38},"Section titled \"What the runner prints\"","What the runner prints",[20,237,238,239,242,243,249,250,253],{},"The ",[24,240,241],{},"acme check"," example from ",[78,244,246],{"href":245},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Ftest\u002Fgolden\u002Fcheck.ts",[24,247,248],{},"test\u002Fgolden\u002Fcheck.ts"," exits ",[24,251,252],{},"1",". On stdout, GitHub Actions gets:",[255,256,258],"pre",{"language":26,"class":257,"wrap":14},"shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,259,261,269,270,269,275,269,280,269,285,269,290,269,295,269,300,269,305,269,309,269,314],{"class":260},"language-text",[262,263,266],"span",{"class":264,"style":265},"line","display: inline",[262,267,268],{},"✖ 2 errors, 1 warning in 212 files (0.8s)","\n",[262,271,272],{"class":264,"style":265},[262,273,274],{},"",[262,276,277],{"class":264,"style":265},[262,278,279],{},"error ACME001  src\u002Fapp.ts:14:3  Route handler reads process.env at module scope",[262,281,282],{"class":264,"style":265},[262,283,284],{},"├▶ why: The value is fixed at build time",[262,286,287],{"class":264,"style":265},[262,288,289],{},"╰▶ fix: Read it inside the handler",[262,291,292],{"class":264,"style":265},[262,293,294],{},"error ACME004  src\u002Fdb.ts:3:1  Top-level await in a server entry",[262,296,297],{"class":264,"style":265},[262,298,299],{},"╰▶ fix: Move the call into the plugin setup",[262,301,302],{"class":264,"style":265},[262,303,304],{},"warn  ACME010  vite.config.ts:8:5  Alias shadows a workspace package",[262,306,307],{"class":264,"style":265},[262,308,274],{},[262,310,311],{"class":264,"style":265},[262,312,313],{},"next: acme check --fix   (applies 2 safe fixes)",[262,315,316],{"class":264,"style":265},[262,317,318],{},"next: acme explain \u003Ccode>   (explains one code)",[20,320,321,322,325,326,329],{},"The command asks \"Apply 2 safe fixes?\" at a terminal. In CI nobody can answer, so ",[24,323,324],{},"out.confirm"," takes its default and adds the ",[24,327,328],{},"next: acme check --fix"," line instead. The row cap is off in CI, so every finding prints.",[20,331,332],{},"On stderr, GitHub Actions gets:",[255,334,335],{"language":26,"class":257,"wrap":14},[24,336,337,269,342,269,347],{"class":260},[262,338,339],{"class":264,"style":265},[262,340,341],{},"::error title=ACME001,file=src\u002Fapp.ts,line=14,col=3::Route handler reads process.env at module scope",[262,343,344],{"class":264,"style":265},[262,345,346],{},"::error title=ACME004,file=src\u002Fdb.ts,line=3,col=1::Top-level await in a server entry",[262,348,349],{"class":264,"style":265},[262,350,351],{},"::warning title=ACME010,file=vite.config.ts,line=8,col=5::Alias shadows a workspace package",[20,353,354,355,358],{},"Annotations go to stderr so ",[24,356,357],{},"acme check > report.txt"," keeps the file free of workflow commands, and the runner still reads them.",[33,360,364],{"id":361,"anchor":362},"githubannotations",{"label":363,"icon":38},"Section titled \"githubAnnotations\"","githubAnnotations",[20,366,238,367,369,370,372,373,376,377,381,382,385,386,389],{},[24,368,26],{}," renderer calls ",[24,371,364],{}," from ",[24,374,375],{},"readerly\u002Fgithub",". A ",[78,378,380],{"href":379},"\u002Fguide\u002Frenderers","custom renderer"," or another tool can call it too. It takes ",[24,383,384],{},"DiagnosticRecord","s and a cap, ",[24,387,388],{},"10"," by default, returns one line per annotation, and prints nothing itself:",[255,391,394],{"language":392,"filename":393,"class":257,"wrap":14},"ts","annotate.ts",[24,395,397,269,420,269,434,269,436,269,461,269,466,269,477,269,487,269,497,269,507,269,517,269,527,269,537,269,542,269,559,269,579,269,584,269,586],{"class":396},"language-ts",[262,398,399,403,406,410,413,417],{"class":264,"style":265},[262,400,402],{"style":401},"color:#CF222E;--shiki-dark:#FF7B72","import",[262,404,405],{"style":401}," type",[262,407,409],{"style":408},"color:#1F2328;--shiki-dark:#E6EDF3"," { DiagnosticRecord } ",[262,411,412],{"style":401},"from",[262,414,416],{"style":415},"color:#0A3069;--shiki-dark:#A5D6FF"," \"readerly\"",[262,418,419],{"style":408},";",[262,421,422,424,427,429,432],{"class":264,"style":265},[262,423,402],{"style":401},[262,425,426],{"style":408}," { githubAnnotations } ",[262,428,412],{"style":401},[262,430,431],{"style":415}," \"readerly\u002Fgithub\"",[262,433,419],{"style":408},[262,435],{"class":264,"style":265},[262,437,438,441,445,448,452,455,458],{"class":264,"style":265},[262,439,440],{"style":401},"const",[262,442,444],{"style":443},"color:#0550AE;--shiki-dark:#79C0FF"," records",[262,446,447],{"style":401},":",[262,449,451],{"style":450},"color:#953800;--shiki-dark:#FFA657"," DiagnosticRecord",[262,453,454],{"style":408},"[] ",[262,456,457],{"style":401},"=",[262,459,460],{"style":408}," [",[262,462,463],{"class":264,"style":265},[262,464,465],{"style":408},"  {",[262,467,468,471,474],{"class":264,"style":265},[262,469,470],{"style":408},"    severity: ",[262,472,473],{"style":415},"\"error\"",[262,475,476],{"style":408},",",[262,478,479,482,485],{"class":264,"style":265},[262,480,481],{"style":408},"    code: ",[262,483,484],{"style":415},"\"ACME020\"",[262,486,476],{"style":408},[262,488,489,492,495],{"class":264,"style":265},[262,490,491],{"style":408},"    message: ",[262,493,494],{"style":415},"\"Port 3000:3001 is taken, 100% of the time\"",[262,496,476],{"style":408},[262,498,499,502,505],{"class":264,"style":265},[262,500,501],{"style":408},"    docs: ",[262,503,504],{"style":415},"\"https:\u002F\u002Facme.dev\u002Fcodes\u002FACME020\"",[262,506,476],{"style":408},[262,508,509,512,515],{"class":264,"style":265},[262,510,511],{"style":408},"    file: ",[262,513,514],{"style":415},"\"src\u002Fa,b.ts\"",[262,516,476],{"style":408},[262,518,519,522,525],{"class":264,"style":265},[262,520,521],{"style":408},"    line: ",[262,523,524],{"style":443},"2",[262,526,476],{"style":408},[262,528,529,532,535],{"class":264,"style":265},[262,530,531],{"style":408},"    column: ",[262,533,534],{"style":443},"7",[262,536,476],{"style":408},[262,538,539],{"class":264,"style":265},[262,540,541],{"style":408},"  },",[262,543,544,547,550,553,556],{"class":264,"style":265},[262,545,546],{"style":408},"  { severity: ",[262,548,549],{"style":415},"\"warn\"",[262,551,552],{"style":408},", message: ",[262,554,555],{"style":415},"\"No file, so no annotation\"",[262,557,558],{"style":408}," },",[262,560,561,563,566,568,571,574,577],{"class":264,"style":265},[262,562,546],{"style":408},[262,564,565],{"style":415},"\"info\"",[262,567,552],{"style":408},[262,569,570],{"style":415},"\"Infos never get one\"",[262,572,573],{"style":408},", file: ",[262,575,576],{"style":415},"\"src\u002Fapp.ts\"",[262,578,558],{"style":408},[262,580,581],{"class":264,"style":265},[262,582,583],{"style":408},"];",[262,585],{"class":264,"style":265},[262,587,588,591,595,598,600],{"class":264,"style":265},[262,589,590],{"style":408},"process.stderr.",[262,592,594],{"style":593},"color:#8250DF;--shiki-dark:#D2A8FF","write",[262,596,597],{"style":408},"(",[262,599,364],{"style":593},[262,601,602],{"style":408},"(records));",[20,604,605],{},"It writes one line:",[255,607,608],{"language":26,"class":257,"wrap":14},[24,609,610],{"class":260},[262,611,612],{"class":264,"style":265},[262,613,614],{},"::error title=ACME020,file=src\u002Fa%2Cb.ts,line=2,col=7::Port 3000:3001 is taken, 100%25 of the time%0Ahttps:\u002F\u002Facme.dev\u002Fcodes\u002FACME020",[616,617,618,634,637,666,672],"ul",{},[619,620,621,622,625,626,629,630,633],"li",{},"Errors become ",[24,623,624],{},"::error"," and warnings ",[24,627,628],{},"::warning",". Infos and records without a ",[24,631,632],{},"file"," are skipped and don't use up the cap.",[619,635,636],{},"The cap counts each kind on its own, in input order: at most 10 errors and 10 warnings.",[619,638,639,642,643,645,646,65,648,219,650,653,654,219,657,660,661,219,663,665],{},[24,640,641],{},"title"," is the ",[24,644,24],{},", then come ",[24,647,632],{},[24,649,264],{},[24,651,652],{},"col",". A range on one line adds ",[24,655,656],{},"endLine",[24,658,659],{},"endColumn",". A range over several lines gives ",[24,662,264],{},[24,664,656],{}," only.",[619,667,668,671],{},[24,669,670],{},"docs"," goes on a second line of the message.",[619,673,674,675,65,678,219,681,684,685,219,687,82],{},"Messages escape ",[24,676,677],{},"%",[24,679,680],{},"\\r",[24,682,683],{},"\\n",". Property values also escape ",[24,686,447],{},[24,688,476],{},[33,690,694],{"id":691,"anchor":692},"a-workflow-step",{"label":693,"icon":38},"Section titled \"A workflow step\"","A workflow step",[20,696,697],{},"A readerly CLI needs no flag on the runner:",[255,699,702],{"language":700,"filename":701,"class":257,"wrap":14},"yaml",".github\u002Fworkflows\u002Fcheck.yml",[24,703,705,269,717,269,736,269,743,269,750,269,760,269,767,269,780,269,791,269,798,269,808,269,820],{"class":704},"language-yaml",[262,706,707,711,714],{"class":264,"style":265},[262,708,710],{"style":709},"color:#116329;--shiki-dark:#7EE787","name",[262,712,713],{"style":408},": ",[262,715,716],{"style":415},"check",[262,718,719,722,725,728,730,733],{"class":264,"style":265},[262,720,721],{"style":443},"on",[262,723,724],{"style":408},": [",[262,726,727],{"style":415},"push",[262,729,65],{"style":408},[262,731,732],{"style":415},"pull_request",[262,734,735],{"style":408},"]",[262,737,738,741],{"class":264,"style":265},[262,739,740],{"style":709},"jobs",[262,742,447],{"style":408},[262,744,745,748],{"class":264,"style":265},[262,746,747],{"style":709},"  check",[262,749,447],{"style":408},[262,751,752,755,757],{"class":264,"style":265},[262,753,754],{"style":709},"    runs-on",[262,756,713],{"style":408},[262,758,759],{"style":415},"ubuntu-latest",[262,761,762,765],{"class":264,"style":265},[262,763,764],{"style":709},"    steps",[262,766,447],{"style":408},[262,768,769,772,775,777],{"class":264,"style":265},[262,770,771],{"style":408},"      - ",[262,773,774],{"style":709},"uses",[262,776,713],{"style":408},[262,778,779],{"style":415},"actions\u002Fcheckout@v4",[262,781,782,784,786,788],{"class":264,"style":265},[262,783,771],{"style":408},[262,785,774],{"style":709},[262,787,713],{"style":408},[262,789,790],{"style":415},"actions\u002Fsetup-node@v4",[262,792,793,796],{"class":264,"style":265},[262,794,795],{"style":709},"        with",[262,797,447],{"style":408},[262,799,800,803,805],{"class":264,"style":265},[262,801,802],{"style":709},"          node-version",[262,804,713],{"style":408},[262,806,807],{"style":443},"24",[262,809,810,812,815,817],{"class":264,"style":265},[262,811,771],{"style":408},[262,813,814],{"style":709},"run",[262,816,713],{"style":408},[262,818,819],{"style":415},"npm ci",[262,821,822,824,826,828],{"class":264,"style":265},[262,823,771],{"style":408},[262,825,814],{"style":709},[262,827,713],{"style":408},[262,829,830],{"style":415},"npx acme check",[20,832,833,834,249,836,838],{},"The step fails when ",[24,835,241],{},[24,837,252],{},", and the pull request shows each annotation on its line.",[33,840,844],{"id":841,"anchor":842},"coding-agents-in-ci",{"label":843,"icon":38},"Section titled \"Coding agents in CI\"","Coding agents in CI",[20,846,847,848,851,852,855,856,859,860,219,863,65,866,868,869,871,872,876],{},"An agent that runs on a runner reads the output, so it gets the ",[24,849,850],{},"agent"," format. ",[24,853,854],{},"AI_AGENT"," and strong markers such as ",[24,857,858],{},"CLAUDECODE"," win over CI. Weak markers never do. With ",[24,861,862],{},"AI_AGENT=claude-code",[24,864,865],{},"GITHUB_ACTIONS=true",[24,867,241],{}," prints the same compact report an agent gets on a laptop, byte for byte, and nothing on stderr. Annotations need ",[24,870,26],{},". See ",[78,873,875],{"href":874},"\u002Fguide\u002Fagents","coding agents"," for the markers.",[878,879,880,881,882],{"id":35,"depth":15,"text":39},{"id":232,"depth":15,"text":235},{"id":361,"depth":15,"text":364},{"id":691,"depth":15,"text":694},{"id":841,"depth":15,"text":844},{"path":884,"title":885,"description":886},"\u002Fintegrations","Overview","Use readerly with GitHub Actions, your argument parser, your test runner, progress lines, Markdown answers and nostics diagnostics.",{"path":888,"title":889,"description":890},"\u002Fintegrations\u002Fargument-parsers","Argument parsers","Use readerly with node:util parseArgs or cac. readerFlags takes the shared reader flags and hands the rest of argv to your parser.",1795985395175,"22ea5d7b-bce0-4e3b-bca3-1fbe3722fcf7"]