issue-handle-question.lock.yml 146 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231
  1. # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"9446bf178e8665b7b64a573e7b7eb9a08fe7aea745dbb1998d195d11bc1ce50d","body_hash":"6abe720ae4f6f1448f02ac60a545c993b7c3d59de773202343c78e1f89b3848b","compiler_version":"v1.0.1","strict":true,"agent_id":"codex","agent_model":"gpt-5.6-luna","engine_versions":{"codex":"0.164.0"}}
  2. # gh-aw-manifest: {"version":1,"secrets":["CODEX_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_DEFAULT_OTLP_ENDPOINT","GH_AW_DEFAULT_OTLP_HEADERS","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","OPENAI_API_KEY","PIXEL_API_KEY"],"actions":[{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/download-artifact","sha":"9000827ccba6bdab643e8b6fd33ac0654aef8333","version":"v8.0.2"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"949feb2413d6458794dcd2491c4babbbce0c15c1","version":"v7.1.0"},{"repo":"actions/upload-artifact","sha":"cf430e030ddbb5b0abf93d22962f4752f3646cd9","version":"v7.0.2"},{"repo":"github/gh-aw-actions/setup","sha":"221ba4f4319de6b8e809d1a15528b3ae6a818aa5","version":"v1.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.29.0","digest":"sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.29.0@sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0","digest":"sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0@sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.29.0","digest":"sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.29.0@sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.5.0","digest":"sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.5.0@sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f","pinned_image":"ghcr.io/github/gh-aw-node@sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f"},{"image":"ghcr.io/github/github-mcp-server:v2.0.3","digest":"sha256:250bc6ce70788207608ef74cef4397230ff2e8481218da74d6093e4bd9101132","pinned_image":"ghcr.io/github/github-mcp-server:v2.0.3@sha256:250bc6ce70788207608ef74cef4397230ff2e8481218da74d6093e4bd9101132"}],"mcp_servers":[{"name":"github","tools":["get_commit","get_file_contents","get_latest_release","get_me","get_pull_request","get_pull_request_comments","get_pull_request_diff","get_pull_request_files","get_pull_request_review_comments","get_pull_request_reviews","get_pull_request_status","get_release_by_tag","get_tag","issue_read","list_branches","list_commits","list_issue_types","list_issues","list_pull_requests","list_releases","list_starred_repositories","list_tags","pull_request_read","search_code","search_issues","search_pull_requests","search_repositories"]},{"name":"safeoutputs","tools":["add_comment","add_labels","noop","report_incomplete","report_missing_data","report_missing_tool","update_issue"]}],"threat_detection":{"mode":"enabled"},"admission":false}
  3. # This file was automatically generated by gh-aw (v1.0.1). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md
  4. #
  5. # ___ _ _
  6. # / _ \ | | (_)
  7. # | |_| | __ _ ___ _ __ | |_ _ ___
  8. # | _ |/ _` |/ _ \ '_ \| __| |/ __|
  9. # | | | | (_| | __/ | | | |_| | (__
  10. # \_| |_/\__, |\___|_| |_|\__|_|\___|
  11. # __/ |
  12. # _ _ |___/
  13. # | | | | / _| |
  14. # | | | | ___ _ __ _ __| |_| | _____ ____
  15. # | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___|
  16. # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
  17. # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
  18. #
  19. #
  20. # To update this file, edit the corresponding .md file and run:
  21. # gh aw compile
  22. # Not all edits will cause changes to this file.
  23. #
  24. # For more information: https://github.github.com/gh-aw/introduction/overview/
  25. #
  26. # 处理分类为 question 的 issue,进行问题分析、咨询和解答
  27. #
  28. # Resolved workflow manifest:
  29. # Imports:
  30. # - shared/engine.md
  31. # - shared/network.md
  32. #
  33. # Secrets used:
  34. # - CODEX_API_KEY
  35. # - COPILOT_GITHUB_TOKEN
  36. # - GH_AW_DEFAULT_OTLP_ENDPOINT
  37. # - GH_AW_DEFAULT_OTLP_HEADERS
  38. # - GH_AW_GITHUB_MCP_SERVER_TOKEN
  39. # - GH_AW_GITHUB_TOKEN
  40. # - GITHUB_TOKEN
  41. # - OPENAI_API_KEY
  42. # - PIXEL_API_KEY
  43. #
  44. # Custom actions used:
  45. # - actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  46. # - actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
  47. # - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  48. # - actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
  49. # - actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  50. # - github/gh-aw-actions/setup@221ba4f4319de6b8e809d1a15528b3ae6a818aa5 # v1.0.1
  51. #
  52. # Container images used:
  53. # - ghcr.io/github/gh-aw-firewall/agent:0.29.0@sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96
  54. # - ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0@sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b
  55. # - ghcr.io/github/gh-aw-firewall/squid:0.29.0@sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50
  56. # - ghcr.io/github/gh-aw-mcpg:v0.5.0@sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc
  57. # - ghcr.io/github/gh-aw-node@sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f
  58. # - ghcr.io/github/github-mcp-server:v2.0.3@sha256:250bc6ce70788207608ef74cef4397230ff2e8481218da74d6093e4bd9101132
  59. name: "Issue Handle Question"
  60. on:
  61. workflow_call:
  62. inputs:
  63. aw_context:
  64. default: ""
  65. description: "Agent caller context (Reserved for Agentic Workflows)."
  66. required: false
  67. type: string
  68. issue_number:
  69. required: true
  70. type: string
  71. payload:
  72. required: false
  73. type: string
  74. outputs:
  75. comment_id:
  76. description: ID of the first added comment
  77. value: ${{ jobs.safe_outputs.outputs.comment_id }}
  78. comment_url:
  79. description: URL of the first added comment
  80. value: ${{ jobs.safe_outputs.outputs.comment_url }}
  81. secrets:
  82. CODEX_API_KEY:
  83. required: false
  84. COPILOT_GITHUB_TOKEN:
  85. required: false
  86. GH_AW_DEFAULT_OTLP_ENDPOINT:
  87. required: false
  88. GH_AW_DEFAULT_OTLP_HEADERS:
  89. required: false
  90. GH_AW_GITHUB_MCP_SERVER_TOKEN:
  91. required: false
  92. GH_AW_GITHUB_TOKEN:
  93. required: false
  94. OPENAI_API_KEY:
  95. required: false
  96. PIXEL_API_KEY:
  97. required: false
  98. # Jobs receive only their explicitly declared permissions.
  99. permissions: {}
  100. concurrency:
  101. group: "gh-aw-issue-handle-question-${{ github.run_id }}"
  102. queue: max
  103. run-name: "Issue Handle Question"
  104. env:
  105. OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.GH_AW_DEFAULT_OTLP_ENDPOINT || vars.GH_AW_DEFAULT_OTLP_ENDPOINT }}
  106. OTEL_SERVICE_NAME: gh-aw.issue-handle-question
  107. OTEL_RESOURCE_ATTRIBUTES: 'gh-aw.workflow.name=Issue%20Handle%20Question,gh-aw.repository=${{ github.repository }},gh-aw.run.id=${{ github.run_id }},github.run_id=${{ github.run_id }},gh-aw.engine.id=codex'
  108. OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.GH_AW_DEFAULT_OTLP_HEADERS }}
  109. GH_AW_OTLP_ENDPOINTS: '[{"url":"${{ secrets.GH_AW_DEFAULT_OTLP_ENDPOINT || vars.GH_AW_DEFAULT_OTLP_ENDPOINT }}","headers":"${{ secrets.GH_AW_DEFAULT_OTLP_HEADERS }}"}]'
  110. GH_AW_OTLP_IF_MISSING: ignore
  111. jobs:
  112. activation:
  113. name: activation
  114. runs-on: ubuntu-slim
  115. # Permissions for the activation job (workflow permissions default to none).
  116. permissions:
  117. actions: read
  118. contents: read
  119. issues: write
  120. env:
  121. GH_AW_MAX_DAILY_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS || '5000' }}
  122. GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }}
  123. outputs:
  124. artifact_prefix: ${{ steps.artifact-prefix.outputs.prefix }}
  125. aw_context: ${{ steps.generate_aw_info.outputs.aw_context }}
  126. comment_id: ""
  127. comment_repo: ""
  128. daily_ai_credits_estimated: ${{ steps.daily-ai-credits-workflow-guardrail.outputs.daily_ai_credits_estimated || '' }}
  129. daily_ai_credits_exceeded: ${{ steps.daily-ai-credits-workflow-guardrail.outputs.daily_ai_credits_exceeded == 'true' }}
  130. daily_ai_credits_guardrail_error: ${{ steps.daily-ai-credits-workflow-guardrail.outputs.daily_ai_credits_guardrail_error || '' }}
  131. daily_ai_credits_guardrail_status: ${{ steps.daily-ai-credits-workflow-guardrail.outputs.daily_ai_credits_guardrail_status || '' }}
  132. daily_ai_credits_threshold: ${{ steps.daily-ai-credits-workflow-guardrail.outputs.daily_ai_credits_threshold || '' }}
  133. daily_ai_credits_total: ${{ steps.daily-ai-credits-workflow-guardrail.outputs.daily_ai_credits_total || '' }}
  134. engine_id: ${{ steps.generate_aw_info.outputs.engine_id }}
  135. lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }}
  136. model: ${{ steps.generate_aw_info.outputs.model }}
  137. oauth_token_check_failed: ${{ steps.check-oauth-tokens.outputs.oauth_token_check_failed == 'true' }}
  138. secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }}
  139. setup-parent-span-id: ${{ steps.setup.outputs.parent-span-id || steps.setup.outputs.span-id }}
  140. setup-span-id: ${{ steps.setup.outputs.span-id }}
  141. setup-trace-id: ${{ steps.setup.outputs.trace-id }}
  142. stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }}
  143. target_checkout_ref: ${{ steps.resolve-host-repo.outputs.target_checkout_ref }}
  144. target_ref: ${{ steps.resolve-host-repo.outputs.target_ref }}
  145. target_repo: ${{ steps.resolve-host-repo.outputs.target_repo }}
  146. target_repo_name: ${{ steps.resolve-host-repo.outputs.target_repo_name }}
  147. steps:
  148. - name: Setup Scripts
  149. id: setup
  150. uses: github/gh-aw-actions/setup@221ba4f4319de6b8e809d1a15528b3ae6a818aa5 # v1.0.1
  151. with:
  152. destination: ${{ runner.temp }}/gh-aw/actions
  153. job-name: ${{ github.job }}
  154. safe-output-artifact-client: ${{ env.GH_AW_MAX_DAILY_AI_CREDITS != '' }}
  155. env:
  156. GH_AW_SETUP_WORKFLOW_NAME: "Issue Handle Question"
  157. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-handle-question.lock.yml@${{ github.ref }}
  158. GH_AW_INFO_VERSION: "0.164.0"
  159. GH_AW_INFO_AWF_VERSION: "v0.29.0"
  160. GH_AW_INFO_ENGINE_ID: "codex"
  161. GH_AW_SETUP_AW_CONTEXT: ${{ inputs.aw_context }}
  162. - name: Mask OTLP telemetry headers
  163. run: bash "${RUNNER_TEMP}/gh-aw/actions/mask_otlp_headers.sh"
  164. - name: Resolve host repo for activation checkout
  165. id: resolve-host-repo
  166. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  167. env:
  168. JOB_WORKFLOW_REPOSITORY: ${{ job.workflow_repository }}
  169. JOB_WORKFLOW_SHA: ${{ job.workflow_sha }}
  170. JOB_WORKFLOW_REF: ${{ job.workflow_ref }}
  171. JOB_WORKFLOW_FILE_PATH: ${{ job.workflow_file_path }}
  172. with:
  173. script: |
  174. const path = require('path');
  175. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  176. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  177. setupGlobals(core, github, context, exec, io, getOctokit);
  178. const { main } = require(path.join(actionsDir, 'resolve_host_repo.cjs'));
  179. await main();
  180. - name: Compute artifact prefix
  181. id: artifact-prefix
  182. env:
  183. INPUTS_JSON: ${{ toJSON(inputs) }}
  184. run: bash "${RUNNER_TEMP}/gh-aw/actions/compute_artifact_prefix.sh"
  185. - name: Generate agentic run info
  186. id: generate_aw_info
  187. env:
  188. GH_AW_INFO_ENGINE_ID: "codex"
  189. GH_AW_INFO_ENGINE_NAME: "Codex"
  190. GH_AW_INFO_MODEL: "gpt-5.6-luna"
  191. GH_AW_INFO_VERSION: "0.164.0"
  192. GH_AW_INFO_AGENT_VERSION: "0.164.0"
  193. GH_AW_INFO_CLI_VERSION: "v1.0.1"
  194. GH_AW_INFO_WORKFLOW_NAME: "Issue Handle Question"
  195. GH_AW_INFO_WORKFLOW_ID: ${{ job.workflow_ref }}
  196. GH_AW_INFO_EXPERIMENTAL: "false"
  197. GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true"
  198. GH_AW_INFO_STAGED: "false"
  199. GH_AW_INFO_ALLOWED_DOMAINS: '["ai-pixel.online","api-inference.modelscope.cn","api.commandcode.ai","api.deepseek.com","api.minimaxi.com","defaults","open.bigmodel.cn","opencode.ai"]'
  200. GH_AW_INFO_FIREWALL_ENABLED: "true"
  201. GH_AW_INFO_AWF_VERSION: "v0.29.0"
  202. GH_AW_INFO_AWMG_VERSION: ""
  203. GH_AW_INFO_FIREWALL_TYPE: "squid"
  204. GH_AW_INFO_AGENT_RUNTIME: ""
  205. GH_AW_INFO_MODEL_CONFIG: '{"routing":{"enabled":false},"models":{"allowed":[],"blocked":[]},"max_ai_credits_source":"default"}'
  206. GH_AW_INFO_MAX_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_AI_CREDITS || '1000' }}
  207. GH_AW_COMPILED_STRICT: "true"
  208. GH_AW_INFO_TARGET_REPO: ${{ steps.resolve-host-repo.outputs.target_repo }}
  209. GH_AW_INFO_MODEL_COSTS: '{"providers":{"openai":{"models":{"gpt-5.6-luna":{"cost":{"cache_read":"2e-08","cache_write":"2.5e-07","input":"2e-07","output":"1.2e-06"}}}}}}'
  210. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  211. with:
  212. script: |
  213. const path = require('path');
  214. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  215. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  216. setupGlobals(core, github, context, exec, io, getOctokit);
  217. const { main } = require(path.join(actionsDir, 'generate_aw_info.cjs'));
  218. await main(core, context);
  219. - name: Restore daily AIC scan observations
  220. id: restore-daily-aic-cache-fallback
  221. if: ${{ env.GH_AW_ADMISSION_RESULT != 'admitted' && env.GH_AW_MAX_DAILY_AI_CREDITS != '' }}
  222. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  223. env:
  224. GH_AW_HAS_SLASH_COMMAND: "false"
  225. GH_AW_HAS_LABEL_COMMAND: "false"
  226. with:
  227. github-token: ${{ secrets.GITHUB_TOKEN }}
  228. script: |
  229. const path = require('path');
  230. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  231. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  232. setupGlobals(core, github, context, exec, io, getOctokit);
  233. const { main } = require(path.join(actionsDir, 'restore_aic_scan_cache.cjs'));
  234. await main();
  235. - name: Check daily workflow token guardrail
  236. id: daily-ai-credits-workflow-guardrail
  237. if: ${{ env.GH_AW_ADMISSION_RESULT != 'admitted' && env.GH_AW_MAX_DAILY_AI_CREDITS != '' }}
  238. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  239. env:
  240. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  241. GH_AW_WORKFLOW_ID: "issue-handle-question"
  242. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  243. GH_AW_WORKFLOW_DISPATCH_AW_CONTEXT: ${{ github.event.inputs.aw_context || '' }}
  244. GH_AW_HAS_SLASH_COMMAND: "false"
  245. GH_AW_HAS_LABEL_COMMAND: "false"
  246. GH_AW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  247. GH_AW_MAX_DAILY_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS || '5000' }}
  248. GH_AW_MAX_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_AI_CREDITS || '1000' }}
  249. with:
  250. github-token: ${{ secrets.GITHUB_TOKEN }}
  251. script: |
  252. const path = require('path');
  253. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  254. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  255. setupGlobals(core, github, context, exec, io, getOctokit);
  256. const { main } = require(path.join(actionsDir, 'check_daily_aic_workflow_guardrail.cjs'));
  257. await main();
  258. - name: Publish daily AIC scan observations
  259. if: always() && env.GH_AW_ADMISSION_RESULT != 'admitted' && env.GH_AW_MAX_DAILY_AI_CREDITS != ''
  260. continue-on-error: true
  261. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  262. with:
  263. name: aic-usage-scan-v2
  264. path: /tmp/gh-aw/agentic-workflow-usage-scan-v2.jsonl
  265. overwrite: true
  266. if-no-files-found: ignore
  267. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '3' }}
  268. - name: Validate CODEX_API_KEY or OPENAI_API_KEY secret
  269. id: validate-secret
  270. run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh" CODEX_API_KEY OPENAI_API_KEY Codex https://github.github.com/gh-aw/reference/engines/#openai-codex
  271. env:
  272. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  273. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  274. - name: Check for OAuth tokens
  275. id: check-oauth-tokens
  276. run: bash "${RUNNER_TEMP}/gh-aw/actions/check_oauth_tokens.sh"
  277. env:
  278. COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
  279. GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  280. GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  281. - name: Print cross-repo setup guidance
  282. if: failure() && steps.resolve-host-repo.outputs.target_repo != github.repository
  283. run: |
  284. echo "::error::COPILOT_GITHUB_TOKEN must be configured in the CALLER repository's secrets."
  285. echo "::error::For cross-repo workflow_call, secrets must be set in the repository that triggers the workflow."
  286. echo "::error::See: https://github.github.com/gh-aw/patterns/central-repo-ops/#cross-repo-setup"
  287. - name: Checkout .github and .agents folders
  288. if: steps.resolve-host-repo.outputs.target_repo == github.repository
  289. uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  290. with:
  291. persist-credentials: false
  292. repository: ${{ steps.resolve-host-repo.outputs.target_repo }}
  293. ref: ${{ steps.resolve-host-repo.outputs.target_checkout_ref }}
  294. sparse-checkout: |
  295. .github
  296. .agents
  297. .claude
  298. .codex
  299. .gemini
  300. .pi
  301. sparse-checkout-cone-mode: true
  302. fetch-depth: 1
  303. - name: Save agent config folders for base branch restoration
  304. env:
  305. GH_AW_AGENT_FOLDERS: ".agents .codex .github"
  306. GH_AW_AGENT_FILES: "AGENTS.md"
  307. run: |
  308. bash "${RUNNER_TEMP}/gh-aw/actions/save_base_github_folders.sh"
  309. - name: Check workflow lock file
  310. id: check-lock-file
  311. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  312. env:
  313. GH_AW_WORKFLOW_FILE: "issue-handle-question.lock.yml"
  314. GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}"
  315. with:
  316. script: |
  317. const path = require('path');
  318. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  319. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  320. setupGlobals(core, github, context, exec, io, getOctokit);
  321. const { main } = require(path.join(actionsDir, 'check_workflow_timestamp_api.cjs'));
  322. await main();
  323. - name: Check compile-agentic version
  324. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  325. env:
  326. GH_AW_COMPILED_VERSION: "v1.0.1"
  327. GH_AW_HAS_SAFE_OUTPUTS: "true"
  328. GH_AW_BLOCKED_VERSION_REPORT_AS_ISSUE: "true"
  329. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  330. with:
  331. script: |
  332. const path = require('path');
  333. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  334. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  335. setupGlobals(core, github, context, exec, io, getOctokit);
  336. const { main } = require(path.join(actionsDir, 'check_version_updates.cjs'));
  337. await main();
  338. - name: Log runtime features
  339. if: ${{ contains(toJSON(vars), '"GH_AW_RUNTIME_FEATURES":') }}
  340. run: bash "${RUNNER_TEMP}/gh-aw/actions/log_runtime_features_summary.sh"
  341. - name: Create prompt with built-in context
  342. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  343. env:
  344. GH_AW_ACTIONS_DIR: ${{ runner.temp }}/gh-aw/actions
  345. GH_AW_PROMPT: ${{ runner.temp }}/gh-aw/aw-prompts/prompt.txt
  346. GH_AW_SAFE_OUTPUTS: ${{ runner.temp }}/gh-aw/safeoutputs/outputs.jsonl
  347. GH_AW_PROMPT_CONFIG: "{\"items\":[{\"content_env\":\"GH_AW_PROMPT_CONTENT_0000\"},{\"file\":\"xpia.md\"},{\"file\":\"temp_folder_prompt.md\"},{\"file\":\"markdown.md\"},{\"file\":\"safe_outputs_mcp_transport_prompt.md\"},{\"file\":\"safe_outputs_prompt.md\"},{\"content_env\":\"GH_AW_PROMPT_CONTENT_0001\"},{\"content_env\":\"GH_AW_PROMPT_CONTENT_0002\"},{\"file\":\"mcp_cli_tools_with_safeoutputs_prompt.md\"},{\"content_env\":\"GH_AW_PROMPT_CONTENT_0003\"},{\"file\":\"github_mcp_tools_with_safeoutputs_prompt.md\"},{\"content_env\":\"GH_AW_PROMPT_CONTENT_0004\"},{\"content_env\":\"GH_AW_PROMPT_CONTENT_0005\"},{\"content_env\":\"GH_AW_PROMPT_CONTENT_0006\"},{\"content_env\":\"GH_AW_PROMPT_CONTENT_0007\"}],\"system_item_count\":12}"
  348. GH_AW_EXPR_76DF9333: ${{ github.event.pull_request.number || (fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_type == 'pull_request' && fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_number) }}
  349. GH_AW_EXPR_77C1A4D2: ${{ github.event.comment.id || fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').comment_id }}
  350. GH_AW_EXPR_7C248226: ${{ github.event.issue.number || (fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_type == 'issue' && fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_number) }}
  351. GH_AW_EXPR_C19C384F: ${{ github.event.discussion.number || (fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_type == 'discussion' && fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_number) }}
  352. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  353. GH_AW_GITHUB_EVENT_ISSUE_TITLE: ${{ github.event.issue.title }}
  354. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  355. GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
  356. GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
  357. GH_AW_INPUTS_ISSUE_NUMBER: ${{ inputs.issue_number }}
  358. GH_AW_PROMPT_CONTENT_0000: "<system>\n"
  359. GH_AW_PROMPT_CONTENT_0001: "<safe-output-tools>\nTools: add_comment, update_issue, add_labels(max:3), report_missing_tool, report_missing_data, noop(max:2)\n"
  360. GH_AW_PROMPT_CONTENT_0002: "</safe-output-tools>\n"
  361. GH_AW_PROMPT_CONTENT_0003: "<github-context>\nThe following GitHub context information is available for this workflow:\n{{#if github.actor}}\n- **actor**: __GH_AW_GITHUB_ACTOR__\n{{/if}}\n{{#if github.repository}}\n- **repository**: __GH_AW_GITHUB_REPOSITORY__\n{{/if}}\n{{#if github.workspace}}\n- **workspace**: __GH_AW_GITHUB_WORKSPACE__\n{{/if}}\n{{#if github.event.issue.number || (github.aw.context.item_type == 'issue' && github.aw.context.item_number)}}\n- **issue-number**: #__GH_AW_EXPR_7C248226__\n{{/if}}\n{{#if github.event.discussion.number || (github.aw.context.item_type == 'discussion' && github.aw.context.item_number)}}\n- **discussion-number**: #__GH_AW_EXPR_C19C384F__\n{{/if}}\n{{#if github.event.pull_request.number || (github.aw.context.item_type == 'pull_request' && github.aw.context.item_number)}}\n- **pull-request-number**: #__GH_AW_EXPR_76DF9333__\n{{/if}}\n{{#if github.event.comment.id || github.aw.context.comment_id}}\n- **comment-id**: __GH_AW_EXPR_77C1A4D2__\n{{/if}}\n{{#if github.run_id}}\n- **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__\n{{/if}}\n</github-context>\n\n"
  362. GH_AW_PROMPT_CONTENT_0004: "</system>\n"
  363. GH_AW_PROMPT_CONTENT_0005: "{{#runtime-import .github/workflows/shared/engine.md}}\n"
  364. GH_AW_PROMPT_CONTENT_0006: "{{#runtime-import .github/workflows/shared/network.md}}\n"
  365. GH_AW_PROMPT_CONTENT_0007: "{{#runtime-import .github/workflows/issue-handle-question.md}}\n"
  366. with:
  367. script: |
  368. const { setupGlobals } = require(process.env.GH_AW_ACTIONS_DIR + '/setup_globals.cjs');
  369. setupGlobals(core, github, context, exec, io, getOctokit);
  370. const { main } = require(process.env.GH_AW_ACTIONS_DIR + '/create_prompt.cjs');
  371. await main(core);
  372. - name: Interpolate variables and render templates
  373. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  374. env:
  375. GH_AW_PROMPT: ${{ runner.temp }}/gh-aw/aw-prompts/prompt.txt
  376. GH_AW_ENGINE_ID: "codex"
  377. GH_AW_SUB_AGENT_DIR: ".codex/agents"
  378. GH_AW_SUB_AGENT_EXT: ".md"
  379. GH_AW_SKILL_DIR: ".codex/skills"
  380. GH_AW_SKILL_EXT: "/SKILL.md"
  381. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  382. GH_AW_GITHUB_EVENT_ISSUE_TITLE: ${{ github.event.issue.title }}
  383. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  384. GH_AW_INPUTS_ISSUE_NUMBER: ${{ inputs.issue_number }}
  385. with:
  386. script: |
  387. const path = require('path');
  388. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  389. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  390. setupGlobals(core, github, context, exec, io, getOctokit);
  391. const { main } = require(path.join(actionsDir, 'interpolate_prompt.cjs'));
  392. await main();
  393. - name: Substitute placeholders
  394. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  395. env:
  396. GH_AW_PROMPT: ${{ runner.temp }}/gh-aw/aw-prompts/prompt.txt
  397. GH_AW_EXPR_76DF9333: ${{ github.event.pull_request.number || (fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_type == 'pull_request' && fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_number) }}
  398. GH_AW_EXPR_77C1A4D2: ${{ github.event.comment.id || fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').comment_id }}
  399. GH_AW_EXPR_7C248226: ${{ github.event.issue.number || (fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_type == 'issue' && fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_number) }}
  400. GH_AW_EXPR_C19C384F: ${{ github.event.discussion.number || (fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_type == 'discussion' && fromJSON(steps.generate_aw_info.outputs.aw_context || '{}').item_number) }}
  401. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  402. GH_AW_GITHUB_EVENT_ISSUE_TITLE: ${{ github.event.issue.title }}
  403. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  404. GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
  405. GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
  406. GH_AW_INPUTS_ISSUE_NUMBER: ${{ inputs.issue_number }}
  407. GH_AW_MCP_CLI_SERVERS_LIST: '- `safeoutputs` — run `safeoutputs --help` to see available tools'
  408. with:
  409. script: |
  410. const path = require('path');
  411. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  412. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  413. setupGlobals(core, github, context, exec, io, getOctokit);
  414. const substitutePlaceholders = require(path.join(actionsDir, 'substitute_placeholders.cjs'));
  415. // Call the substitution function
  416. return await substitutePlaceholders({
  417. file: process.env.GH_AW_PROMPT,
  418. substitutions: {
  419. GH_AW_EXPR_76DF9333: process.env.GH_AW_EXPR_76DF9333,
  420. GH_AW_EXPR_77C1A4D2: process.env.GH_AW_EXPR_77C1A4D2,
  421. GH_AW_EXPR_7C248226: process.env.GH_AW_EXPR_7C248226,
  422. GH_AW_EXPR_C19C384F: process.env.GH_AW_EXPR_C19C384F,
  423. GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR,
  424. GH_AW_GITHUB_EVENT_ISSUE_TITLE: process.env.GH_AW_GITHUB_EVENT_ISSUE_TITLE,
  425. GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY,
  426. GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID,
  427. GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE,
  428. GH_AW_INPUTS_ISSUE_NUMBER: process.env.GH_AW_INPUTS_ISSUE_NUMBER,
  429. GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST
  430. }
  431. });
  432. - name: Validate prompt placeholders
  433. env:
  434. GH_AW_PROMPT: ${{ runner.temp }}/gh-aw/aw-prompts/prompt.txt
  435. run: |
  436. bash "${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh"
  437. - name: Print prompt
  438. env:
  439. GH_AW_PROMPT: ${{ runner.temp }}/gh-aw/aw-prompts/prompt.txt
  440. run: |
  441. bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh"
  442. - name: Inventory installed skills
  443. if: success() || failure()
  444. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  445. env:
  446. GH_AW_SKILL_DIR: ".codex/skills"
  447. with:
  448. script: |
  449. const path = require('path');
  450. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  451. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  452. setupGlobals(core, github, context, exec, io, getOctokit);
  453. const { main } = require(path.join(actionsDir, 'skill_inventory.cjs'));
  454. await main();
  455. - name: Upload info artifact
  456. if: success() || failure()
  457. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  458. with:
  459. name: ${{ steps.artifact-prefix.outputs.prefix }}info
  460. path: /tmp/gh-aw/aw_info.json
  461. if-no-files-found: ignore
  462. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }}
  463. - name: Stage prompt files for artifact upload
  464. run: |
  465. mkdir -p /tmp/gh-aw/aw-prompts
  466. cp -a "${RUNNER_TEMP}/gh-aw/aw-prompts/." /tmp/gh-aw/aw-prompts/
  467. - name: Upload activation artifact
  468. if: success() || failure()
  469. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  470. with:
  471. name: ${{ steps.artifact-prefix.outputs.prefix }}activation
  472. include-hidden-files: true
  473. path: |
  474. /tmp/gh-aw/aw_info.json
  475. /tmp/gh-aw/models.json
  476. /tmp/gh-aw/aw-prompts/prompt.txt
  477. /tmp/gh-aw/aw-prompts/system.txt
  478. /tmp/gh-aw/aw-prompts/user.txt
  479. /tmp/gh-aw/aw-prompts/prompt-template.txt
  480. /tmp/gh-aw/aw-prompts/prompt-import-tree.json
  481. /tmp/gh-aw/github_rate_limits.jsonl
  482. /tmp/gh-aw/base
  483. /tmp/gh-aw/.codex/agents
  484. /tmp/gh-aw/.codex/skills
  485. /tmp/gh-aw/skill_inventory.json
  486. if-no-files-found: ignore
  487. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '1' }}
  488. agent:
  489. name: agent
  490. needs: activation
  491. if: needs.activation.outputs.daily_ai_credits_exceeded != 'true'
  492. runs-on: ubuntu-latest
  493. # Permissions for the agent job (workflow permissions default to none).
  494. permissions:
  495. actions: read
  496. checks: read
  497. contents: read
  498. discussions: read
  499. issues: read
  500. pull-requests: read
  501. statuses: read
  502. concurrency:
  503. group: "gh-aw-codex-issue-handle-question"
  504. queue: max
  505. timeout-minutes: 60
  506. env:
  507. DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
  508. GH_AW_ASSETS_ALLOWED_EXTS: ""
  509. GH_AW_ASSETS_BRANCH: ""
  510. GH_AW_ASSETS_MAX_SIZE_KB: 0
  511. GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
  512. GH_AW_PR_HEAD_BASE_BRANCH: ""
  513. GH_AW_PR_HEAD_BASE_PR_NUMBER: ""
  514. GH_AW_PR_HEAD_BASE_REF: ""
  515. GH_AW_PR_HEAD_BASE_REPO: ""
  516. GH_AW_PR_HEAD_BASE_SHA: ""
  517. GH_AW_PR_HEAD_REPO: ""
  518. GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }}
  519. GH_AW_TARGET_REPO_SLUG: ""
  520. GH_AW_WORKFLOW_ID_SANITIZED: issuehandlequestion
  521. outputs:
  522. agentic_engine_timeout: ${{ steps.detect-agent-errors.outputs.agentic_engine_timeout || 'false' }}
  523. ai_credits_rate_limit_error: ${{ steps.parse-mcp-gateway.outputs.ai_credits_rate_limit_error || 'false' }}
  524. aic: ${{ steps.parse-token-usage.outputs.aic }}
  525. ambient_context: ${{ steps.parse-token-usage.outputs.ambient_context }}
  526. artifact_prefix: ${{ needs.activation.outputs.artifact_prefix }}
  527. checkout_pr_invalidated: ${{ steps.checkout-pr.outputs.checkout_pr_invalidated || 'false' }}
  528. checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }}
  529. has_patch: ${{ steps.collect_output.outputs.has_patch }}
  530. http_400_response_error: ${{ steps.detect-agent-errors.outputs.http_400_response_error || 'false' }}
  531. inference_access_error: ${{ steps.detect-agent-errors.outputs.inference_access_error || 'false' }}
  532. invocation_cap_exceeded: ${{ steps.detect-agent-errors.outputs.invocation_cap_exceeded || 'false' }}
  533. max_cache_misses_exceeded: ${{ steps.detect-agent-errors.outputs.max_cache_misses_exceeded || 'false' }}
  534. mcp_policy_error: ${{ steps.detect-agent-errors.outputs.mcp_policy_error || 'false' }}
  535. missing_model_pricing_error: ${{ steps.detect-agent-errors.outputs.missing_model_pricing_error || 'false' }}
  536. missing_model_pricing_model_name: ${{ steps.detect-agent-errors.outputs.missing_model_pricing_model_name || '' }}
  537. model: ${{ needs.activation.outputs.model }}
  538. model_endpoint_mismatch_error: ${{ steps.detect-agent-errors.outputs.model_endpoint_mismatch_error || 'false' }}
  539. model_not_supported_error: ${{ steps.detect-agent-errors.outputs.model_not_supported_error || 'false' }}
  540. output: ${{ steps.collect_output.outputs.output }}
  541. output_types: ${{ steps.collect_output.outputs.output_types }}
  542. setup-parent-span-id: ${{ steps.setup.outputs.parent-span-id || steps.setup.outputs.span-id }}
  543. setup-span-id: ${{ steps.setup.outputs.span-id }}
  544. setup-trace-id: ${{ steps.setup.outputs.trace-id }}
  545. shell_expansion_guard_rejected: ${{ steps.detect-agent-errors.outputs.shell_expansion_guard_rejected || 'false' }}
  546. unknown_model_ai_credits: ${{ steps.parse-mcp-gateway.outputs.unknown_model_ai_credits || 'false' }}
  547. steps:
  548. - name: Setup Scripts
  549. id: setup
  550. uses: github/gh-aw-actions/setup@221ba4f4319de6b8e809d1a15528b3ae6a818aa5 # v1.0.1
  551. with:
  552. destination: ${{ runner.temp }}/gh-aw/actions
  553. job-name: ${{ github.job }}
  554. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  555. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  556. env:
  557. GH_AW_SETUP_WORKFLOW_NAME: "Issue Handle Question"
  558. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-handle-question.lock.yml@${{ github.ref }}
  559. GH_AW_INFO_VERSION: "0.164.0"
  560. GH_AW_INFO_AWF_VERSION: "v0.29.0"
  561. GH_AW_INFO_ENGINE_ID: "codex"
  562. GH_AW_SETUP_AW_CONTEXT: ${{ inputs.aw_context }}
  563. - name: Set runtime paths
  564. id: set-runtime-paths
  565. env:
  566. GH_AW_RUNNER_TOOL_CACHE: ${{ runner.tool_cache }}
  567. run: | # zizmor: ignore[github-env] - runner.tool_cache is set by GitHub Actions, not user input.
  568. if [ -z "${RUNNER_TOOL_CACHE:-}" ]; then
  569. echo "RUNNER_TOOL_CACHE=${GH_AW_RUNNER_TOOL_CACHE}" >> "$GITHUB_ENV"
  570. fi
  571. {
  572. echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl"
  573. echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json"
  574. echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json"
  575. } >> "$GITHUB_OUTPUT"
  576. - name: Mask OTLP telemetry headers
  577. run: bash "${RUNNER_TEMP}/gh-aw/actions/mask_otlp_headers.sh"
  578. - name: Check OTLP telemetry configuration
  579. run: bash "${RUNNER_TEMP}/gh-aw/actions/check_otlp_default_credentials.sh"
  580. - name: Checkout repository (gh-aw default)
  581. uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  582. with:
  583. persist-credentials: false
  584. - name: Initialize agent execution evidence
  585. run: |
  586. mkdir -p "/tmp/gh-aw"
  587. evidence_tmp="/tmp/gh-aw/agent_execution.json.tmp"
  588. printf '{"version":1,"component":"agent","run_id":%s,"run_attempt":%s,"state":"not_started"}\n' "$GITHUB_RUN_ID" "$GITHUB_RUN_ATTEMPT" > "$evidence_tmp"
  589. mv "$evidence_tmp" "/tmp/gh-aw/agent_execution.json"
  590. - name: Create gh-aw temp directory
  591. run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh"
  592. - name: Configure gh CLI for GitHub Enterprise
  593. run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh"
  594. env:
  595. GH_TOKEN: ${{ github.token }}
  596. - name: Download activation artifact
  597. uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
  598. with:
  599. name: ${{ needs.activation.outputs.artifact_prefix }}activation
  600. path: /tmp/gh-aw
  601. - name: Configure Git credentials
  602. env:
  603. GITHUB_REPOSITORY: ${{ github.repository }}
  604. GITHUB_SERVER_URL: ${{ github.server_url }}
  605. GITHUB_TOKEN: ${{ github.token }}
  606. run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_git_credentials.sh"
  607. - name: Checkout PR branch
  608. id: checkout-pr
  609. if: |
  610. github.event.pull_request || github.event.issue.pull_request || github.event_name == 'workflow_dispatch'
  611. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  612. env:
  613. GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  614. with:
  615. github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  616. script: |
  617. const path = require('path');
  618. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  619. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  620. setupGlobals(core, github, context, exec, io, getOctokit);
  621. const { main } = require(path.join(actionsDir, 'checkout_pr_branch.cjs'));
  622. await main();
  623. - name: Setup Node.js
  624. uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
  625. with:
  626. node-version: '24'
  627. package-manager-cache: false
  628. - name: Install Codex CLI
  629. run: npm install --ignore-scripts -g @openai/codex@0.164.0
  630. - name: Install AWF binary
  631. run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.29.0 --rootless
  632. - name: Determine automatic lockdown mode for GitHub MCP Server
  633. id: determine-automatic-lockdown
  634. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  635. env:
  636. GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  637. GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  638. GH_AW_GITHUB_MIN_INTEGRITY: 'none'
  639. with:
  640. script: |
  641. const path = require('path');
  642. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  643. const determineAutomaticLockdown = require(path.join(actionsDir, 'determine_automatic_lockdown.cjs'));
  644. await determineAutomaticLockdown(github, context, core);
  645. - name: Parse integrity filter lists
  646. id: parse-guard-vars
  647. env:
  648. GH_AW_BLOCKED_USERS_VAR: ${{ vars.GH_AW_GITHUB_BLOCKED_USERS || '' }}
  649. GH_AW_TRUSTED_USERS_VAR: ${{ vars.GH_AW_GITHUB_TRUSTED_USERS || '' }}
  650. GH_AW_APPROVAL_LABELS_VAR: ${{ vars.GH_AW_GITHUB_APPROVAL_LABELS || '' }}
  651. run: bash "${RUNNER_TEMP}/gh-aw/actions/parse_guard_list.sh"
  652. - name: Restore agent config folders from base branch
  653. if: steps.checkout-pr.outcome == 'success'
  654. env:
  655. GH_AW_AGENT_FOLDERS: ".agents .codex .github"
  656. GH_AW_AGENT_FILES: "AGENTS.md"
  657. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh"
  658. - name: Restore inline sub-agents from activation artifact
  659. env:
  660. GH_AW_SUB_AGENT_DIR: ".codex/agents"
  661. GH_AW_SUB_AGENT_EXT: ".md"
  662. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_sub_agents.sh"
  663. - name: Restore inline skills from activation artifact
  664. env:
  665. GH_AW_SKILL_DIR: ".codex/skills"
  666. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_skills.sh"
  667. - name: Download container images
  668. run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.29.0@sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96 ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0@sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b ghcr.io/github/gh-aw-firewall/squid:0.29.0@sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50 ghcr.io/github/gh-aw-mcpg:v0.5.0@sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc ghcr.io/github/gh-aw-node@sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f ghcr.io/github/github-mcp-server:v2.0.3@sha256:250bc6ce70788207608ef74cef4397230ff2e8481218da74d6093e4bd9101132
  669. - name: Configure Codex
  670. run: |
  671. "$(command -v node)" "${RUNNER_TEMP}/gh-aw/actions/convert_gateway_config_codex.cjs" --bootstrap
  672. env:
  673. CODEX_HOME: /tmp/gh-aw/mcp-config
  674. GH_AW_CODEX_CONFIG_JSON: '{"defaults":{"features":{"plugins":false},"history":{"persistence":"none"},"mcp_servers":{"github":{"http_headers":{"User-Agent":"issue-handle-question"},"startup_timeout_sec":120,"tool_timeout_sec":60},"safeoutputs":{"startup_timeout_sec":120,"tool_timeout_sec":60}},"model_provider":"openai-proxy","model_providers":{"openai-proxy":{"base_url":"http://172.30.0.30:10000","env_key":"CODEX_API_KEY","name":"OpenAI AWF proxy","requires_openai_auth":false,"supports_websockets":false,"wire_api":"responses"}},"otel":{"metrics_exporter":"none"},"shell_environment_policy":{"ignore_default_excludes":false,"include_only":["ALL_PROXY","CURL_CA_BUNDLE","GITHUB_WORKSPACE","GIT_AUTHOR_EMAIL","GIT_AUTHOR_NAME","GIT_COMMITTER_EMAIL","GIT_COMMITTER_NAME","HOME","HTTPS_PROXY","HTTP_PROXY","LANG","LC_ALL","LC_CTYPE","LOGNAME","NODE_EXTRA_CA_CERTS","NO_PROXY","OPENAI_BASE_URL","PATH","PLAYWRIGHT_BROWSERS_PATH","REQUESTS_CA_BUNDLE","RUNNER_TEMP","RUNNER_TOOL_CACHE","SHELL","SSL_CERT_DIR","SSL_CERT_FILE","TEMP","TMP","TMPDIR","USER","all_proxy","http_proxy","https_proxy","no_proxy"],"inherit":"all"}},"overrides":{},"disablePlugins":true}'
  675. - name: Prepare Safe Outputs Directories
  676. run: |
  677. mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"
  678. mkdir -p /tmp/gh-aw/safeoutputs
  679. mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
  680. - name: Generate Safe Outputs Config
  681. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  682. env:
  683. GH_AW_FILE_ROOT: "${{ runner.temp }}/gh-aw"
  684. GH_AW_FILE_CONFIG: "{\"files\":[{\"path\":\"safeoutputs/config.json\",\"content_env\":\"GH_AW_SAFE_OUTPUTS_CONFIG\"}]}"
  685. GH_AW_SAFE_OUTPUTS_CONFIG: "{\"add_comment\":{\"max\":1,\"target\":\"${GH_AW_INPUT_ISSUE_NUMBER}\"},\"add_labels\":{\"max\":3,\"target\":\"${GH_AW_INPUT_ISSUE_NUMBER}\"},\"create_report_incomplete_issue\":{},\"noop\":{\"max\":2,\"report-as-issue\":\"false\"},\"report_incomplete\":{},\"report_missing_data\":{},\"report_missing_tool\":{},\"update_issue\":{\"allow_body\":true,\"max\":1,\"target\":\"${GH_AW_INPUT_ISSUE_NUMBER}\"}}"
  686. GH_AW_INPUT_ISSUE_NUMBER: ${{ inputs.issue_number }}
  687. with:
  688. script: |
  689. const path = require('path');
  690. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  691. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  692. setupGlobals(core, github, context, exec, io, getOctokit);
  693. const { main } = require(path.join(actionsDir, 'create_files.cjs'));
  694. await main();
  695. - name: Generate Safe Outputs Tools
  696. env:
  697. GH_AW_TOOLS_META_JSON: |
  698. {
  699. "description_suffixes": {
  700. "add_comment": " CONSTRAINTS: Maximum 1 comment(s) can be added. Target: ${GH_AW_INPUTS_ISSUE_NUMBER}. Supports reply_to_id for discussion threading.",
  701. "add_labels": " CONSTRAINTS: Maximum 3 add_labels call(s) allowed. Maximum 10 label(s) per call. Target: ${GH_AW_INPUTS_ISSUE_NUMBER}.",
  702. "update_issue": " CONSTRAINTS: Maximum 1 issue(s) can be updated. Target: ${GH_AW_INPUTS_ISSUE_NUMBER}."
  703. },
  704. "repo_params": {},
  705. "dynamic_tools": []
  706. }
  707. GH_AW_VALIDATION_JSON: |
  708. {
  709. "add_comment": {
  710. "defaultMax": 1,
  711. "fields": {
  712. "body": {
  713. "required": true,
  714. "type": "string",
  715. "sanitize": true,
  716. "maxLength": 65000
  717. },
  718. "comment_id": {
  719. "optionalPositiveInteger": true
  720. },
  721. "item_number": {
  722. "issueOrPRNumber": true
  723. },
  724. "pr": {
  725. "issueOrPRNumber": true
  726. },
  727. "pr_number": {
  728. "issueOrPRNumber": true
  729. },
  730. "reply_to_id": {
  731. "type": "string",
  732. "maxLength": 256
  733. },
  734. "repo": {
  735. "type": "string",
  736. "maxLength": 256
  737. },
  738. "target": {
  739. "type": "string",
  740. "enum": [
  741. "status"
  742. ]
  743. },
  744. "temporary_id": {
  745. "type": "string",
  746. "pattern": "^#?aw_[A-Za-z0-9_]{3,12}$"
  747. }
  748. }
  749. },
  750. "add_labels": {
  751. "defaultMax": 5,
  752. "fields": {
  753. "item_number": {
  754. "issueNumberOrTemporaryId": true
  755. },
  756. "labels": {
  757. "required": true,
  758. "type": "array"
  759. },
  760. "repo": {
  761. "type": "string",
  762. "maxLength": 256
  763. }
  764. }
  765. },
  766. "noop": {
  767. "defaultMax": 2,
  768. "fields": {
  769. "message": {
  770. "required": true,
  771. "type": "string",
  772. "sanitize": true,
  773. "maxLength": 65000
  774. }
  775. }
  776. },
  777. "report_incomplete": {
  778. "defaultMax": 5,
  779. "fields": {
  780. "details": {
  781. "type": "string",
  782. "sanitize": true,
  783. "maxLength": 65000
  784. },
  785. "reason": {
  786. "required": true,
  787. "type": "string",
  788. "sanitize": true,
  789. "maxLength": 1024
  790. }
  791. }
  792. },
  793. "report_missing_data": {
  794. "defaultMax": 20,
  795. "fields": {
  796. "alternatives": {
  797. "type": "string",
  798. "sanitize": true,
  799. "maxLength": 256
  800. },
  801. "context": {
  802. "type": "string",
  803. "sanitize": true,
  804. "maxLength": 256
  805. },
  806. "data_type": {
  807. "type": "string",
  808. "sanitize": true,
  809. "maxLength": 128
  810. },
  811. "reason": {
  812. "type": "string",
  813. "sanitize": true,
  814. "maxLength": 256
  815. }
  816. }
  817. },
  818. "report_missing_tool": {
  819. "defaultMax": 20,
  820. "fields": {
  821. "alternatives": {
  822. "type": "string",
  823. "sanitize": true,
  824. "maxLength": 512
  825. },
  826. "reason": {
  827. "required": true,
  828. "type": "string",
  829. "sanitize": true,
  830. "maxLength": 256
  831. },
  832. "tool": {
  833. "type": "string",
  834. "sanitize": true,
  835. "maxLength": 128
  836. }
  837. }
  838. },
  839. "update_issue": {
  840. "defaultMax": 1,
  841. "fields": {
  842. "assignees": {
  843. "type": "array",
  844. "itemType": "string",
  845. "itemSanitize": true,
  846. "itemMaxLength": 39
  847. },
  848. "body": {
  849. "type": "string",
  850. "sanitize": true,
  851. "maxLength": 65000
  852. },
  853. "issue_number": {
  854. "issueOrPRNumber": true
  855. },
  856. "labels": {
  857. "type": "array"
  858. },
  859. "milestone": {
  860. "optionalPositiveInteger": true,
  861. "allowNull": true
  862. },
  863. "operation": {
  864. "type": "string",
  865. "enum": [
  866. "replace",
  867. "append",
  868. "prepend",
  869. "replace-island"
  870. ]
  871. },
  872. "repo": {
  873. "type": "string",
  874. "maxLength": 256
  875. },
  876. "status": {
  877. "type": "string",
  878. "enum": [
  879. "open",
  880. "closed"
  881. ]
  882. },
  883. "title": {
  884. "type": "string",
  885. "sanitize": true,
  886. "maxLength": 128
  887. }
  888. },
  889. "customValidation": "requiresOneOf:status,title,body,labels,assignees,milestone"
  890. }
  891. }
  892. GH_AW_INPUTS_ISSUE_NUMBER: ${{ inputs.issue_number }}
  893. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  894. with:
  895. script: |
  896. const path = require('path');
  897. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  898. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  899. setupGlobals(core, github, context, exec, io, getOctokit);
  900. const { main } = require(path.join(actionsDir, 'generate_safe_outputs_tools.cjs'));
  901. await main();
  902. - name: Start MCP Gateway
  903. id: start-mcp-gateway
  904. env:
  905. CODEX_HOME: /tmp/gh-aw/mcp-config
  906. DEBUG: ${{ env.DEBUG || runner.debug == '1' && '*' || '' }}
  907. GH_AW_GUARD_APPROVAL_LABELS: ${{ steps.parse-guard-vars.outputs.approval_labels }}
  908. GH_AW_GUARD_BLOCKED_USERS: ${{ steps.parse-guard-vars.outputs.blocked_users }}
  909. GH_AW_GUARD_TRUSTED_USERS: ${{ steps.parse-guard-vars.outputs.trusted_users }}
  910. GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST: ${{ vars.GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST || 'true' }}
  911. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  912. GH_AW_SAFE_OUTPUTS_CONFIG_PATH: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS_CONFIG_PATH }}
  913. GH_AW_SAFE_OUTPUTS_TOOLS_PATH: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS_TOOLS_PATH }}
  914. GH_AW_SINK_VISIBILITY: ${{ steps.determine-automatic-lockdown.outputs.visibility }}
  915. GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  916. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  917. GH_AW_INPUT_ISSUE_NUMBER: ${{ inputs.issue_number }}
  918. run: |
  919. set -eo pipefail
  920. mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config"
  921. if [ -n "${GITHUB_EVENT_PATH:-}" ] && [ -r "${GITHUB_EVENT_PATH}" ]; then
  922. GH_AW_SAFEOUTPUTS_EVENT_PATH="${RUNNER_TEMP}/gh-aw/safeoutputs/github_event.json"
  923. cp "${GITHUB_EVENT_PATH}" "${GH_AW_SAFEOUTPUTS_EVENT_PATH}"
  924. export GITHUB_EVENT_PATH="${GH_AW_SAFEOUTPUTS_EVENT_PATH}"
  925. fi
  926. # Export gateway environment variables for MCP config and gateway script
  927. export MCP_GATEWAY_PORT="8080"
  928. export MCP_GATEWAY_DOMAIN="awmg-mcpg"
  929. export MCP_GATEWAY_HOST_DOMAIN="localhost"
  930. MCP_GATEWAY_AGENT_ID=$(openssl rand -base64 45 | tr -d '/+=')
  931. echo "::add-mask::${MCP_GATEWAY_AGENT_ID}"
  932. export MCP_GATEWAY_AGENT_ID
  933. export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
  934. mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
  935. export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
  936. export MCP_GATEWAY_ALLOWED_MOUNT_ROOTS="${GITHUB_WORKSPACE}:rw,${RUNNER_TEMP}/gh-aw:ro,${RUNNER_TEMP}/gh-aw/safeoutputs:rw,/opt:ro,/tmp:rw,/usr/bin/gh:ro"
  937. export GH_AW_PR_HEAD_BASE_BRANCH="${GH_AW_PR_HEAD_BASE_BRANCH:-}"
  938. export GH_AW_PR_HEAD_BASE_SHA="${GH_AW_PR_HEAD_BASE_SHA:-}"
  939. export GH_AW_PR_HEAD_BASE_REPO="${GH_AW_PR_HEAD_BASE_REPO:-}"
  940. export GH_AW_PR_HEAD_BASE_PR_NUMBER="${GH_AW_PR_HEAD_BASE_PR_NUMBER:-}"
  941. export GH_AW_PR_HEAD_BASE_REF="${GH_AW_PR_HEAD_BASE_REF:-}"
  942. export GH_AW_PR_HEAD_REPO="${GH_AW_PR_HEAD_REPO:-}"
  943. export GH_AW_TARGET_REPO_SLUG="${GH_AW_TARGET_REPO_SLUG:-}"
  944. export GH_AW_ENGINE="codex"
  945. MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')
  946. MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')
  947. source "${RUNNER_TEMP}/gh-aw/actions/resolve_docker_socket_gid.sh"
  948. export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network bridge -p 127.0.0.1:'"${MCP_GATEWAY_PORT}"':'"${MCP_GATEWAY_PORT}"' --name awmg-mcpg --add-host host.docker.internal:host-gateway --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_AGENT_ID -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_TARGET_REPO_SLUG -e GH_AW_PR_HEAD_BASE_BRANCH -e GH_AW_PR_HEAD_BASE_SHA -e GH_AW_PR_HEAD_BASE_REPO -e GH_AW_PR_HEAD_BASE_PR_NUMBER -e GH_AW_PR_HEAD_BASE_REF -e GH_AW_PR_HEAD_REPO -e GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GH_AW_SINK_VISIBILITY -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e RUNNER_TEMP -e RUNNER_TOOL_CACHE -e MCP_GATEWAY_ALLOWED_MOUNT_ROOTS -e GITHUB_AW_OTEL_TRACE_ID -e GITHUB_AW_OTEL_PARENT_SPAN_ID -e OTEL_EXPORTER_OTLP_HEADERS -e GH_AW_INPUT_ISSUE_NUMBER -e CODEX_HOME -e GH_AW_GUARD_APPROVAL_LABELS -e GH_AW_GUARD_BLOCKED_USERS -e GH_AW_GUARD_TRUSTED_USERS -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw -v '"${RUNNER_TEMP}"'/gh-aw/safeoutputs:'"${RUNNER_TEMP}"'/gh-aw/safeoutputs:rw ghcr.io/github/gh-aw-mcpg:v0.5.0@sha256:d3544a4222e7efeeeb38669d8a1af0c72691c55b8f6506b15aa5920f7f31b7bc'
  949. export GH_AW_CODEX_CONFIG="${RUNNER_TEMP}/gh-aw/mcp-config/codex-config.json"
  950. # Generate JSON config for MCP gateway
  951. GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
  952. cat << GH_AW_MCP_CONFIG_a600c4d2fb8a8959_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
  953. {
  954. "mcpServers": {
  955. "github": {
  956. "container": "ghcr.io/github/github-mcp-server:v2.0.3",
  957. "env": {
  958. "GITHUB_FEATURES": "fields_param",
  959. "GITHUB_HOST": "$GITHUB_SERVER_URL",
  960. "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_MCP_SERVER_TOKEN",
  961. "GITHUB_READ_ONLY": "1",
  962. "GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
  963. },
  964. "guard-policies": {
  965. "allow-only": {
  966. "approval-labels": ${GH_AW_GUARD_APPROVAL_LABELS},
  967. "blocked-users": ${GH_AW_GUARD_BLOCKED_USERS},
  968. "min-integrity": "none",
  969. "repos": "all",
  970. "trusted-users": ${GH_AW_GUARD_TRUSTED_USERS}
  971. }
  972. }
  973. },
  974. "safeoutputs": {
  975. "container": "ghcr.io/github/gh-aw-node@sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f",
  976. "mounts": ["\${GITHUB_WORKSPACE}:\${GITHUB_WORKSPACE}:rw", "${RUNNER_TEMP}/gh-aw/safeoutputs:${RUNNER_TEMP}/gh-aw/safeoutputs:rw", "/tmp/gh-aw:/tmp/gh-aw:rw"],
  977. "args": ["-w", "\${GITHUB_WORKSPACE}"],
  978. "entrypoint": "sh",
  979. "entrypointArgs": ["-c", "sh ${RUNNER_TEMP}/gh-aw/safeoutputs/start_safe_outputs_mcp.sh"],
  980. "env": {
  981. "DEBUG": "\${DEBUG}",
  982. "DEFAULT_BRANCH": "\${DEFAULT_BRANCH}",
  983. "GH_AW_ASSETS_ALLOWED_EXTS": "\${GH_AW_ASSETS_ALLOWED_EXTS}",
  984. "GH_AW_ASSETS_BRANCH": "\${GH_AW_ASSETS_BRANCH}",
  985. "GH_AW_ASSETS_MAX_SIZE_KB": "\${GH_AW_ASSETS_MAX_SIZE_KB}",
  986. "GH_AW_MCP_LOG_DIR": "\${GH_AW_MCP_LOG_DIR}",
  987. "GH_AW_SAFE_OUTPUTS": "\${GH_AW_SAFE_OUTPUTS}",
  988. "GH_AW_SAFE_OUTPUTS_CONFIG_PATH": "\${GH_AW_SAFE_OUTPUTS_CONFIG_PATH}",
  989. "GH_AW_SAFE_OUTPUTS_TOOLS_PATH": "\${GH_AW_SAFE_OUTPUTS_TOOLS_PATH}",
  990. "GH_AW_TARGET_REPO_SLUG": "\${GH_AW_TARGET_REPO_SLUG}",
  991. "GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST": "\${GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST}",
  992. "GH_AW_PR_HEAD_BASE_BRANCH": "\${GH_AW_PR_HEAD_BASE_BRANCH}",
  993. "GH_AW_PR_HEAD_BASE_SHA": "\${GH_AW_PR_HEAD_BASE_SHA}",
  994. "GH_AW_PR_HEAD_BASE_REPO": "\${GH_AW_PR_HEAD_BASE_REPO}",
  995. "GH_AW_PR_HEAD_BASE_PR_NUMBER": "\${GH_AW_PR_HEAD_BASE_PR_NUMBER}",
  996. "GH_AW_PR_HEAD_BASE_REF": "\${GH_AW_PR_HEAD_BASE_REF}",
  997. "GH_AW_PR_HEAD_REPO": "\${GH_AW_PR_HEAD_REPO}",
  998. "GITHUB_EVENT_NAME": "\${GITHUB_EVENT_NAME}",
  999. "GITHUB_EVENT_PATH": "\${GITHUB_EVENT_PATH}",
  1000. "GITHUB_REPOSITORY": "\${GITHUB_REPOSITORY}",
  1001. "GITHUB_SHA": "\${GITHUB_SHA}",
  1002. "GITHUB_TOKEN": "\${GITHUB_TOKEN}",
  1003. "GITHUB_WORKSPACE": "\${GITHUB_WORKSPACE}",
  1004. "RUNNER_TEMP": "\${RUNNER_TEMP}",
  1005. "GH_AW_INPUT_ISSUE_NUMBER": "\${GH_AW_INPUT_ISSUE_NUMBER}"
  1006. },
  1007. "guard-policies": {
  1008. "write-sink": {
  1009. "accept": [
  1010. "*"
  1011. ],
  1012. "sink-visibility": "${GH_AW_SINK_VISIBILITY}"
  1013. }
  1014. }
  1015. }
  1016. },
  1017. "gateway": {
  1018. "port": $MCP_GATEWAY_PORT,
  1019. "domain": "${MCP_GATEWAY_DOMAIN}",
  1020. "agentId": "${MCP_GATEWAY_AGENT_ID}",
  1021. "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}",
  1022. "startupTimeout": 120,
  1023. "opentelemetry": {
  1024. "endpoint": "${OTEL_EXPORTER_OTLP_ENDPOINT}",
  1025. "traceId": "${GITHUB_AW_OTEL_TRACE_ID}",
  1026. "spanId": "${GITHUB_AW_OTEL_PARENT_SPAN_ID}"
  1027. }
  1028. }
  1029. }
  1030. GH_AW_MCP_CONFIG_a600c4d2fb8a8959_EOF
  1031. # Sync converter output to writable CODEX_HOME for Codex
  1032. mkdir -p "${CODEX_HOME}"
  1033. if [ "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" != "${CODEX_HOME}/config.toml" ]; then cp "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" "${CODEX_HOME}/config.toml"; fi
  1034. chmod 600 "${CODEX_HOME}/config.toml"
  1035. - name: Mount MCP servers as CLIs
  1036. id: mount-mcp-clis
  1037. continue-on-error: true
  1038. env:
  1039. MCP_GATEWAY_AGENT_ID: ${{ steps.start-mcp-gateway.outputs.gateway-agent-id }}
  1040. MCP_GATEWAY_DOMAIN: ${{ steps.start-mcp-gateway.outputs.gateway-domain }}
  1041. MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
  1042. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1043. with:
  1044. script: |
  1045. const path = require('path');
  1046. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1047. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1048. setupGlobals(core, github, context, exec, io);
  1049. const { main } = require(path.join(actionsDir, 'mount_mcp_as_cli.cjs'));
  1050. await main();
  1051. - name: Clean credentials
  1052. run: |
  1053. bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh"
  1054. bash "${RUNNER_TEMP}/gh-aw/actions/verify_git_credentials.sh"
  1055. - name: Audit pre-agent workspace
  1056. id: pre_agent_audit
  1057. continue-on-error: true
  1058. run: bash "${RUNNER_TEMP}/gh-aw/actions/audit_pre_agent_workspace.sh"
  1059. - name: Log GitHub rate limits at agent start
  1060. continue-on-error: true
  1061. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1062. with:
  1063. github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1064. script: |
  1065. const path = require('path');
  1066. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1067. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1068. setupGlobals(core, github, context, exec, io, getOctokit);
  1069. const { fetchAndLogRateLimit } = require(path.join(actionsDir, 'github_rate_limit_logger.cjs'));
  1070. await fetchAndLogRateLimit(github, 'agent_start', true);
  1071. - name: Execute Codex CLI
  1072. id: agentic_execution
  1073. timeout-minutes: 15
  1074. run: |
  1075. set -o pipefail
  1076. gh_aw_exit_code=0
  1077. trap 'gh_aw_exit_code=$?; mkdir -p /tmp/gh-aw >/dev/null 2>&1 || true; printf "%s" "$gh_aw_exit_code" > /tmp/gh-aw/agent_execution_exit_code.txt || true; if [ "$gh_aw_exit_code" -ne 0 ]; then echo "::error::Agent execution exited with code $gh_aw_exit_code"; fi' EXIT
  1078. printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
  1079. mkdir -p "$CODEX_HOME/logs" && touch /tmp/gh-aw/agent-step-summary.md
  1080. (umask 177 && touch /tmp/gh-aw/agent-stdio.log)
  1081. GH_AW_MAX_AI_CREDITS="${GH_AW_MAX_AI_CREDITS:-1000}"
  1082. if [[ ! "$GH_AW_MAX_AI_CREDITS" =~ ^[0-9]+$ ]]; then
  1083. GH_AW_MAX_AI_CREDITS="1000"
  1084. fi
  1085. if [[ "${GH_AW_ADMISSION_RESULT:-}" == "admitted" && -z "${GH_AW_ADMISSION_MAX_AI_CREDITS:-}" ]]; then
  1086. echo "ERR_ADMISSION: Missing required runtime admission allowance." >&2
  1087. exit 1
  1088. fi
  1089. if [[ "${GH_AW_ADMISSION_RESULT:-}" == "admitted" && -n "${GH_AW_ADMISSION_MAX_AI_CREDITS:-}" ]]; then
  1090. if [[ ! "$GH_AW_ADMISSION_MAX_AI_CREDITS" =~ ^[1-9][0-9]{0,9}$ ]] || (( GH_AW_ADMISSION_MAX_AI_CREDITS > 2147483647 )); then
  1091. echo "ERR_ADMISSION: Invalid runtime admission allowance." >&2
  1092. exit 1
  1093. fi
  1094. GH_AW_MAX_AI_CREDITS="$GH_AW_ADMISSION_MAX_AI_CREDITS"
  1095. echo "Admission allowance applied (value withheld)."
  1096. else
  1097. echo "No component admission allowance; retaining existing budget policy (value withheld)."
  1098. fi
  1099. unset GH_AW_ADMISSION_RESULT GH_AW_ADMISSION_MAX_AI_CREDITS
  1100. printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.29.0/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"ai-pixel.online\",\"api-inference.modelscope.cn\",\"api.commandcode.ai\",\"api.deepseek.com\",\"api.minimaxi.com\",\"api.snapcraft.io\",\"archive.ubuntu.com\",\"azure.archive.ubuntu.com\",\"crl.geotrust.com\",\"crl.globalsign.com\",\"crl.identrust.com\",\"crl.sectigo.com\",\"crl.thawte.com\",\"crl.usertrust.com\",\"crl.verisign.com\",\"crl3.digicert.com\",\"crl4.digicert.com\",\"crls.ssl.com\",\"json-schema.org\",\"json.schemastore.org\",\"keyserver.ubuntu.com\",\"ocsp.digicert.com\",\"ocsp.geotrust.com\",\"ocsp.globalsign.com\",\"ocsp.identrust.com\",\"ocsp.sectigo.com\",\"ocsp.ssl.com\",\"ocsp.thawte.com\",\"ocsp.usertrust.com\",\"ocsp.verisign.com\",\"open.bigmodel.cn\",\"opencode.ai\",\"packagecloud.io\",\"packages.cloud.google.com\",\"packages.microsoft.com\",\"ppa.launchpad.net\",\"s.symcb.com\",\"s.symcd.com\",\"security.ubuntu.com\",\"ts-crl.ws.symantec.com\",\"ts-ocsp.ws.symantec.com\",\"www.googleapis.com\"],\"isolation\":true,\"topologyAttach\":[\"awmg-mcpg\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"hostedWeb\":{\"codex\":{\"enabled\":false}},\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"modelFallback\":{\"enabled\":false},\"targets\":{\"openai\":{\"host\":\"ai-pixel.online\"}},\"providers\":{\"openai\":{\"models\":{\"gpt-5.6-luna\":{\"cost\":{\"cache_read\":\"2e-08\",\"cache_write\":\"2.5e-07\",\"input\":\"2e-07\",\"output\":\"1.2e-06\"}}}}},\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-6\",\"gpt-5.4\",\"gpt-5.5\",\"gpt-5.6\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"auto\":[\"copilot/auto\",\"large\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"detection\":[\"small\"],\"evals\":[\"small\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-3.6-flash\":[\"copilot/gemini-3.6*flash*\",\"google/gemini-3.6*flash*\",\"gemini/gemini-3.6*flash*\"],\"gemini-3.7-flash\":[\"copilot/gemini-3.7*flash*\",\"google/gemini-3.7*flash*\",\"gemini/gemini-3.7*flash*\"],\"gemini-3.8-flash\":[\"copilot/gemini-3.8*flash*\",\"google/gemini-3.8*flash*\",\"gemini/gemini-3.8*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"gpt-6\":[\"copilot/gpt-6*\",\"openai/gpt-6*\"],\"grok\":[\"copilot/*grok*\",\"openai/*grok*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"sonnet\",\"gpt-6\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"raptor-mini\":[\"copilot/raptor*\",\"openai/raptor*\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-5*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\",\"anthropic/*sonnet-5*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.29.0,squid=sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50,agent=sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96,api-proxy=sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b,cli-proxy=sha256:087a8e4efff8ac62d46e106cd22005c002822b1481fc233097799511be353b5d\",\"agentTimeout\":15},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
  1101. cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
  1102. export GH_AW_MODELS_JSON_PATH="/tmp/gh-aw/models.json"
  1103. GH_AW_DOCKER_HOST=""
  1104. if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then
  1105. GH_AW_DOCKER_HOST="${DOCKER_HOST}"
  1106. fi
  1107. if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then
  1108. GH_AW_CHROOT_BINARIES_SOURCE_PATH="${RUNNER_TEMP}/gh-aw" GH_AW_CHROOT_IDENTITY_HOME="${RUNNER_TEMP}/gh-aw/home" node "${RUNNER_TEMP}/gh-aw/actions/patch_awf_chroot_config.cjs"
  1109. fi
  1110. GH_AW_TOOL_CACHE_MOUNT=""
  1111. GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:?RUNNER_TOOL_CACHE must be set}"
  1112. if [ -d "$GH_AW_TOOL_CACHE" ]; then
  1113. if [[ "$GH_AW_TOOL_CACHE" != /opt/* ]]; then
  1114. GH_AW_TOOL_CACHE_MOUNT="$GH_AW_TOOL_CACHE:$GH_AW_TOOL_CACHE:ro"
  1115. fi
  1116. fi
  1117. # shellcheck disable=SC1003,SC2016,SC2086
  1118. mkdir -p "/tmp/gh-aw"
  1119. evidence_tmp="/tmp/gh-aw/agent_execution.json.tmp"
  1120. printf '{"version":1,"component":"agent","run_id":%s,"run_attempt":%s,"state":"started"}\n' "$GITHUB_RUN_ID" "$GITHUB_RUN_ATTEMPT" > "$evidence_tmp"
  1121. mv "$evidence_tmp" "/tmp/gh-aw/agent_execution.json"
  1122. export GH_AW_AWF_EXECUTION_COMPONENT="agent"
  1123. export GH_AW_AWF_EXECUTION_EVIDENCE_FILE="/tmp/gh-aw/agent_execution.json"
  1124. GH_AW_AWF_ENGINE_NAME=codex \
  1125. GH_AW_AWF_HARNESS_MARKER='[codex-harness]' \
  1126. GH_AW_AWF_LOG_FILE=/tmp/gh-aw/agent-stdio.log \
  1127. GH_AW_AWF_ATTEMPT_LOG_NAME=codex \
  1128. bash "${RUNNER_TEMP}/gh-aw/actions/run_awf_with_startup_retries.sh" -- \
  1129. awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" ${GH_AW_TOOL_CACHE_MOUNT:+--mount "$GH_AW_TOOL_CACHE_MOUNT"} ${GH_AW_DOCKER_HOST:+--docker-host "$GH_AW_DOCKER_HOST"} --env-all --exclude-env ACTIONS_ID_TOKEN_REQUEST_TOKEN --exclude-env ACTIONS_ID_TOKEN_REQUEST_URL --exclude-env CODEX_API_KEY --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GH_AW_OTLP_ALL_HEADERS --exclude-env GH_AW_OTLP_ENDPOINTS --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_AGENT_ID --exclude-env OPENAI_API_KEY --exclude-env OTEL_EXPORTER_OTLP_ENDPOINT --exclude-env OTEL_EXPORTER_OTLP_HEADERS --mount /tmp/gh-aw:/tmp/gh-aw:rw --log-level info --skip-pull \
  1130. -- /bin/bash -c 'set +o histexpand; export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && : "${RUNNER_TOOL_CACHE:?RUNNER_TOOL_CACHE must be set}"; GH_AW_TOOL_CACHE="$RUNNER_TOOL_CACHE"; GH_AW_TOOL_BINS="$(find "$GH_AW_TOOL_CACHE" -maxdepth 5 -type d -name bin 2>/dev/null | tr "\n" ":")"; GH_AW_TOOL_BINS="${GH_AW_TOOL_BINS%:}"; export PATH="$PATH${GH_AW_TOOL_BINS:+:}$GH_AW_TOOL_BINS"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true; [ -n "$ERLANG_HOME" ] && export PATH="$ERLANG_HOME/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; GH_AW_NPM_GLOBAL_ROOT="$(npm root -g 2>/dev/null || true)"; if [ -n "$GH_AW_NPM_GLOBAL_ROOT" ]; then export NODE_PATH="${GH_AW_NPM_GLOBAL_ROOT}${NODE_PATH:+:${NODE_PATH}}"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/codex_harness.cjs codex exec${GH_AW_MODEL_AGENT_CODEX:+ --model "$GH_AW_MODEL_AGENT_CODEX"} -c web_search="disabled" --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt'
  1131. env:
  1132. AWF_REFLECT_ENABLED: 1
  1133. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
  1134. CODEX_HOME: /tmp/gh-aw/mcp-config
  1135. GH_AW_INPUT_ISSUE_NUMBER: ${{ inputs.issue_number }}
  1136. GH_AW_LLM_PROVIDER: openai
  1137. GH_AW_MAX_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_AI_CREDITS || '1000' }}
  1138. GH_AW_MAX_TURNS: ${{ vars.GH_AW_DEFAULT_MAX_TURNS || '' }}
  1139. GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/config.toml
  1140. GH_AW_MODEL_AGENT_CODEX: gpt-5.6-luna
  1141. GH_AW_PHASE: agent
  1142. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  1143. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  1144. GH_AW_VERSION: v1.0.1
  1145. GITHUB_AW: true
  1146. GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
  1147. GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
  1148. GIT_AUTHOR_NAME: github-actions[bot]
  1149. GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
  1150. GIT_COMMITTER_NAME: github-actions[bot]
  1151. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1152. OPENAI_BASE_URL: https://ai-pixel.online
  1153. RUNNER_TEMP: ${{ runner.temp }}
  1154. RUST_LOG: ${{ runner.debug == 1 && 'trace,hyper_util=info,mio=info,reqwest=info,os_info=info,codex_otel=warn,codex_core=debug,codex_exec=debug' || 'warn' }}
  1155. TRACEPARENT: ${{ env.GITHUB_AW_OTEL_TRACE_ID != '' && env.GITHUB_AW_OTEL_PARENT_SPAN_ID != '' && format('00-{0}-{1}-01', env.GITHUB_AW_OTEL_TRACE_ID, env.GITHUB_AW_OTEL_PARENT_SPAN_ID) || '' }}
  1156. - name: Log GitHub rate limits at agent end
  1157. if: always()
  1158. continue-on-error: true
  1159. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1160. with:
  1161. github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1162. script: |
  1163. const path = require('path');
  1164. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1165. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1166. setupGlobals(core, github, context, exec, io, getOctokit);
  1167. const { fetchAndLogRateLimit } = require(path.join(actionsDir, 'github_rate_limit_logger.cjs'));
  1168. await fetchAndLogRateLimit(github, 'agent_end', true);
  1169. - name: Detect agent errors
  1170. if: always()
  1171. id: detect-agent-errors
  1172. continue-on-error: true
  1173. env:
  1174. GH_AW_AGENTIC_EXECUTION_OUTCOME: ${{ steps.agentic_execution.outcome }}
  1175. GH_AW_ENGINE_STEP_TIMEOUT_MINUTES: 15
  1176. GH_AW_ENGINE_INTERNAL_LOGS_DIR: /tmp/gh-aw/mcp-config/logs
  1177. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1178. with:
  1179. script: |
  1180. const path = require('path');
  1181. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1182. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1183. setupGlobals(core, github, context, exec, io, getOctokit);
  1184. const { main } = require(path.join(actionsDir, 'detect_agent_errors.cjs'));
  1185. await main();
  1186. - name: Configure Git credentials
  1187. env:
  1188. GITHUB_REPOSITORY: ${{ github.repository }}
  1189. GITHUB_SERVER_URL: ${{ github.server_url }}
  1190. GITHUB_TOKEN: ${{ github.token }}
  1191. run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_git_credentials.sh"
  1192. - name: Stop MCP Gateway
  1193. if: always()
  1194. continue-on-error: true
  1195. env:
  1196. MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
  1197. MCP_GATEWAY_AGENT_ID: ${{ steps.start-mcp-gateway.outputs.gateway-agent-id }}
  1198. GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }}
  1199. run: |
  1200. bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID"
  1201. - name: Redact secrets in logs
  1202. id: redact_secrets
  1203. if: always()
  1204. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1205. with:
  1206. script: |
  1207. const path = require('path');
  1208. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1209. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1210. setupGlobals(core, github, context, exec, io, getOctokit);
  1211. const { main } = require(path.join(actionsDir, 'redact_secrets.cjs'));
  1212. await main();
  1213. env:
  1214. GH_AW_SECRET_NAMES: 'CODEX_API_KEY,GH_AW_GITHUB_MCP_SERVER_TOKEN,GH_AW_GITHUB_TOKEN,GITHUB_TOKEN,OPENAI_API_KEY,PIXEL_API_KEY'
  1215. SECRET_CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  1216. SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  1217. SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  1218. SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1219. SECRET_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  1220. SECRET_PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1221. - name: Append agent step summary
  1222. if: always()
  1223. run: bash "${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh"
  1224. - name: Copy Safe Outputs
  1225. if: always()
  1226. env:
  1227. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  1228. run: |
  1229. mkdir -p /tmp/gh-aw
  1230. cp "$GH_AW_SAFE_OUTPUTS" /tmp/gh-aw/safeoutputs.jsonl 2>/dev/null || true
  1231. - name: Ingest agent output
  1232. id: collect_output
  1233. if: always()
  1234. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1235. env:
  1236. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  1237. GH_AW_ALLOWED_DOMAINS: "ai-pixel.online,api-inference.modelscope.cn,api.commandcode.ai,api.deepseek.com,api.minimaxi.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,open.bigmodel.cn,opencode.ai,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,s.symcb.com,s.symcd.com,security.ubuntu.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com"
  1238. GITHUB_SERVER_URL: ${{ github.server_url }}
  1239. GITHUB_API_URL: ${{ github.api_url }}
  1240. with:
  1241. script: |
  1242. const path = require('path');
  1243. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1244. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1245. setupGlobals(core, github, context, exec, io, getOctokit);
  1246. const { main } = require(path.join(actionsDir, 'collect_ndjson_output.cjs'));
  1247. await main();
  1248. - name: Parse agent logs for step summary
  1249. if: always()
  1250. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1251. env:
  1252. GH_AW_AGENT_OUTPUT: /tmp/gh-aw/agent-stdio.log
  1253. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  1254. with:
  1255. script: |
  1256. const path = require('path');
  1257. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1258. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1259. setupGlobals(core, github, context, exec, io, getOctokit);
  1260. const { main } = require(path.join(actionsDir, 'parse_codex_log.cjs'));
  1261. await main();
  1262. - name: Parse MCP Gateway logs for step summary
  1263. if: always()
  1264. id: parse-mcp-gateway
  1265. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1266. with:
  1267. script: |
  1268. const path = require('path');
  1269. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1270. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1271. setupGlobals(core, github, context, exec, io, getOctokit);
  1272. const { main } = require(path.join(actionsDir, 'parse_mcp_gateway_log.cjs'));
  1273. await main();
  1274. - name: Print firewall logs
  1275. if: always()
  1276. continue-on-error: true
  1277. env:
  1278. AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
  1279. run: bash "${RUNNER_TEMP}/gh-aw/actions/print_firewall_logs.sh" --rootless
  1280. - name: Parse token usage for step summary
  1281. if: always()
  1282. id: parse-token-usage
  1283. continue-on-error: true
  1284. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1285. with:
  1286. script: |
  1287. const path = require('path');
  1288. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1289. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1290. setupGlobals(core, github, context, exec, io, getOctokit);
  1291. const { main } = require(path.join(actionsDir, 'parse_token_usage.cjs'));
  1292. await main();
  1293. - name: Print AWF reflect summary
  1294. if: always()
  1295. continue-on-error: true
  1296. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1297. with:
  1298. script: |
  1299. const path = require('path');
  1300. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1301. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1302. setupGlobals(core, github, context, exec, io, getOctokit);
  1303. const { main } = require(path.join(actionsDir, 'awf_reflect_summary.cjs'));
  1304. await main();
  1305. - name: Generate observability summary
  1306. if: always()
  1307. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1308. with:
  1309. script: |
  1310. const path = require('path');
  1311. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1312. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1313. setupGlobals(core, github, context, exec, io, getOctokit);
  1314. const { main } = require(path.join(actionsDir, 'generate_observability_summary.cjs'));
  1315. await main(core);
  1316. - name: Write agent output placeholder if missing
  1317. if: always()
  1318. run: |
  1319. if [ ! -f /tmp/gh-aw/agent_output.json ]; then
  1320. echo '{"items":[]}' > /tmp/gh-aw/agent_output.json
  1321. fi
  1322. # Small dedicated copy of the agent output so safe-output processing
  1323. # survives a failed or timed-out upload of the larger agent artifact
  1324. - name: Upload agent output fallback artifact
  1325. if: always() && steps.redact_secrets.outcome == 'success'
  1326. continue-on-error: true
  1327. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  1328. with:
  1329. name: ${{ needs.activation.outputs.artifact_prefix }}agent-output-fallback
  1330. path: |
  1331. /tmp/gh-aw/agent_output.json
  1332. /tmp/gh-aw/safeoutputs.jsonl
  1333. /tmp/gh-aw/agent_execution.json
  1334. /tmp/gh-aw/agent_execution_exit_code.txt
  1335. /tmp/gh-aw/agent_usage.jsonl
  1336. /tmp/gh-aw/agent_usage.json
  1337. /tmp/gh-aw/agent/harness_retry.json
  1338. /tmp/gh-aw/agent/model-endpoint-mismatch.json
  1339. /tmp/gh-aw/sandbox/firewall-audit-logs/api-proxy-logs/token-usage.jsonl
  1340. /tmp/gh-aw/sandbox/firewall-audit-logs/api-proxy-logs/model-routing.jsonl
  1341. /tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs/token-usage.jsonl
  1342. /tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs/model-routing.jsonl
  1343. /tmp/gh-aw/sandbox/firewall/audit/api-proxy-logs/token-usage.jsonl
  1344. /tmp/gh-aw/sandbox/firewall/audit/api-proxy-logs/model-routing.jsonl
  1345. /tmp/gh-aw/awf-resolved-config.json
  1346. if-no-files-found: ignore
  1347. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }}
  1348. - name: Upload agent artifacts
  1349. if: always() && steps.redact_secrets.outcome == 'success'
  1350. continue-on-error: true
  1351. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  1352. with:
  1353. name: ${{ needs.activation.outputs.artifact_prefix }}agent
  1354. path: |
  1355. /tmp/gh-aw/aw-prompts/prompt.txt
  1356. /tmp/gh-aw/agent_execution.json
  1357. /tmp/gh-aw/agent_execution_exit_code.txt
  1358. /tmp/gh-aw/agent-session.jsonl
  1359. /tmp/gh-aw/agent-errors.jsonl
  1360. /tmp/gh-aw/aw-prompts/user.txt
  1361. /tmp/gh-aw/aw-prompts/system.txt
  1362. /tmp/gh-aw/skill_inventory.json
  1363. /tmp/gh-aw/mcp-config/logs/
  1364. /tmp/gh-aw/redacted-urls.log
  1365. /tmp/gh-aw/mcp-logs/
  1366. /tmp/gh-aw/proxy-logs/
  1367. !/tmp/gh-aw/proxy-logs/proxy-tls/
  1368. /tmp/gh-aw/agent_usage.json
  1369. /tmp/gh-aw/agent/model-resolution.json
  1370. /tmp/gh-aw/agent-stdio.log
  1371. /tmp/gh-aw/agent/harness_retry.json
  1372. /tmp/gh-aw/pre-agent-audit.txt
  1373. /tmp/gh-aw/github_rate_limits.jsonl
  1374. /tmp/gh-aw/otel.jsonl
  1375. /tmp/gh-aw/otlp-export-errors.jsonl
  1376. /tmp/gh-aw/safeoutputs.jsonl
  1377. /tmp/gh-aw/agent_output.json
  1378. /tmp/gh-aw/aw-*.patch
  1379. /tmp/gh-aw/aw-*.bundle
  1380. /tmp/gh-aw/awf-config.json
  1381. /tmp/gh-aw/awf-resolved-config.json
  1382. /tmp/gh-aw/sandbox/firewall/logs/
  1383. /tmp/gh-aw/sandbox/firewall/audit/
  1384. /tmp/gh-aw/sandbox/firewall/awf-reflect.json
  1385. if-no-files-found: ignore
  1386. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }}
  1387. conclusion:
  1388. name: conclusion
  1389. needs:
  1390. - activation
  1391. - agent
  1392. - detection
  1393. - safe_outputs
  1394. if: >
  1395. always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' ||
  1396. needs.activation.outputs.oauth_token_check_failed == 'true' || needs.activation.outputs.stale_lock_file_failed == 'true' ||
  1397. needs.activation.outputs.secret_verification_result == 'failed' || needs.activation.outputs.daily_ai_credits_exceeded == 'true' ||
  1398. needs.activation.outputs.daily_ai_credits_guardrail_status == 'structural_error' || needs.activation.outputs.daily_ai_credits_guardrail_status == 'transient_error')
  1399. runs-on: ubuntu-slim
  1400. # Permissions for the conclusion job (workflow permissions default to none).
  1401. permissions:
  1402. actions: read
  1403. checks: read
  1404. issues: write
  1405. pull-requests: write
  1406. concurrency:
  1407. group: "gh-aw-conclusion-issue-handle-question"
  1408. cancel-in-progress: false
  1409. queue: max
  1410. env:
  1411. GH_AW_JOB_DISPLAY_NAMES: "{\"activation\":\"activation\",\"agent\":\"agent\",\"conclusion\":\"conclusion\",\"detection\":\"detection\",\"safe_outputs\":\"safe_outputs\"}"
  1412. GH_AW_JOB_RESULTS: "{\"activation\":{\"result\":\"${{ needs.activation.result }}\"},\"agent\":{\"result\":\"${{ needs.agent.result }}\"},\"detection\":{\"result\":\"${{ needs.detection.result }}\"},\"safe_outputs\":{\"result\":\"${{ needs.safe_outputs.result }}\"}}"
  1413. GH_AW_JOB_TIMING_ELIGIBLE: "{\"activation\":true,\"agent\":true,\"conclusion\":true,\"detection\":true,\"safe_outputs\":true}"
  1414. GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }}
  1415. outputs:
  1416. incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }}
  1417. noop_comment_body: ${{ steps.noop.outputs.noop_comment_body }}
  1418. noop_message: ${{ steps.noop.outputs.noop_message }}
  1419. tools_reported: ${{ steps.missing_tool.outputs.tools_reported }}
  1420. total_count: ${{ steps.missing_tool.outputs.total_count }}
  1421. steps:
  1422. - name: Setup Scripts
  1423. id: setup
  1424. uses: github/gh-aw-actions/setup@221ba4f4319de6b8e809d1a15528b3ae6a818aa5 # v1.0.1
  1425. with:
  1426. destination: ${{ runner.temp }}/gh-aw/actions
  1427. job-name: ${{ github.job }}
  1428. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1429. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  1430. env:
  1431. GH_AW_SETUP_WORKFLOW_NAME: "Issue Handle Question"
  1432. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-handle-question.lock.yml@${{ github.ref }}
  1433. GH_AW_INFO_VERSION: "0.164.0"
  1434. GH_AW_INFO_AWF_VERSION: "v0.29.0"
  1435. GH_AW_INFO_ENGINE_ID: "codex"
  1436. GH_AW_SETUP_AW_CONTEXT: ${{ inputs.aw_context }}
  1437. - name: Download agent output artifact
  1438. id: download-agent-output
  1439. continue-on-error: true
  1440. uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
  1441. with:
  1442. pattern: "{${{ needs.activation.outputs.artifact_prefix }}agent,${{ needs.activation.outputs.artifact_prefix }}agent-output-fallback}"
  1443. merge-multiple: true
  1444. path: /tmp/gh-aw/
  1445. - name: Setup agent output environment variable
  1446. id: setup-agent-output-env
  1447. if: steps.download-agent-output.outcome == 'success'
  1448. run: |
  1449. mkdir -p /tmp/gh-aw/
  1450. find "/tmp/gh-aw/" -type f -print
  1451. if [ -f "/tmp/gh-aw/agent_output.json" ]; then
  1452. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1453. fi
  1454. - name: Warn if threat detection produced no verdict
  1455. if: always() && needs.detection.result != 'skipped' && (needs.detection.outputs.detection_reason == 'agent_failure' || needs.detection.outputs.detection_reason == 'parse_error' || needs.detection.outputs.detection_conclusion == '')
  1456. run: echo "::warning::Threat detection produced no security verdict. Review the detection job logs before trusting the agent outputs."
  1457. - name: Download detection artifact
  1458. id: download-detection-artifact
  1459. continue-on-error: true
  1460. uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
  1461. with:
  1462. name: ${{ needs.activation.outputs.artifact_prefix }}detection
  1463. path: /tmp/gh-aw/threat-detection/
  1464. - name: Download Safe Outputs Items Manifest
  1465. id: download-safe-outputs-manifest
  1466. if: always()
  1467. continue-on-error: true
  1468. uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
  1469. with:
  1470. pattern: ${{ needs.activation.outputs.artifact_prefix }}safe-outputs-items
  1471. merge-multiple: true
  1472. path: /tmp/gh-aw/
  1473. - name: Process no-op messages
  1474. id: noop
  1475. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1476. env:
  1477. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1478. GH_AW_NOOP_MAX: "2"
  1479. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  1480. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-handle-question.md"
  1481. GH_AW_ENGINE_ID: "codex"
  1482. GH_AW_ENGINE_MODEL: "gpt-5.6-luna"
  1483. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1484. GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
  1485. GH_AW_NOOP_REPORT_AS_ISSUE: "false"
  1486. GH_AW_AIC: ${{ needs.agent.outputs.aic }}
  1487. GH_AW_THREAT_DETECTION_AIC: ${{ needs.detection.outputs.aic }}
  1488. GH_AW_AMBIENT_CONTEXT: ${{ needs.agent.outputs.ambient_context }}
  1489. GH_AW_WORKFLOW_ID: "issue-handle-question"
  1490. with:
  1491. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1492. script: |
  1493. const path = require('path');
  1494. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1495. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1496. setupGlobals(core, github, context, exec, io, getOctokit);
  1497. const { main } = require(path.join(actionsDir, 'handle_noop_message.cjs'));
  1498. await main();
  1499. - name: Log detection run
  1500. id: detection_runs
  1501. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1502. env:
  1503. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1504. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  1505. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-handle-question.md"
  1506. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1507. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  1508. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  1509. with:
  1510. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1511. script: |
  1512. const path = require('path');
  1513. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1514. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1515. setupGlobals(core, github, context, exec, io, getOctokit);
  1516. const { main } = require(path.join(actionsDir, 'handle_detection_runs.cjs'));
  1517. await main();
  1518. - name: Record missing tool
  1519. id: missing_tool
  1520. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1521. env:
  1522. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1523. GH_AW_MISSING_TOOL_CREATE_ISSUE: "true"
  1524. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  1525. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-handle-question.md"
  1526. GH_AW_ENGINE_ID: "codex"
  1527. GH_AW_ENGINE_MODEL: "gpt-5.6-luna"
  1528. with:
  1529. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1530. script: |
  1531. const path = require('path');
  1532. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1533. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1534. setupGlobals(core, github, context, exec, io, getOctokit);
  1535. const { main } = require(path.join(actionsDir, 'missing_tool.cjs'));
  1536. await main();
  1537. - name: Record incomplete
  1538. id: report_incomplete
  1539. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1540. env:
  1541. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1542. GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true"
  1543. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  1544. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-handle-question.md"
  1545. GH_AW_ENGINE_ID: "codex"
  1546. GH_AW_ENGINE_MODEL: "gpt-5.6-luna"
  1547. with:
  1548. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1549. script: |
  1550. const path = require('path');
  1551. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1552. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1553. setupGlobals(core, github, context, exec, io, getOctokit);
  1554. const { main } = require(path.join(actionsDir, 'report_incomplete_handler.cjs'));
  1555. await main();
  1556. - name: Handle agent failure
  1557. id: handle_agent_failure
  1558. if: always()
  1559. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1560. env:
  1561. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1562. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  1563. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-handle-question.md"
  1564. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1565. GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
  1566. GH_AW_WORKFLOW_ID: "issue-handle-question"
  1567. GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168"
  1568. GH_AW_ENGINE_ID: "codex"
  1569. GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
  1570. GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
  1571. GH_AW_CHECKOUT_PR_INVALIDATED: ${{ needs.agent.outputs.checkout_pr_invalidated }}
  1572. GH_AW_AI_CREDITS_RATE_LIMIT_ERROR: ${{ needs.agent.outputs.ai_credits_rate_limit_error || 'false' }}
  1573. GH_AW_UNKNOWN_MODEL_AI_CREDITS: ${{ needs.agent.outputs.unknown_model_ai_credits || 'false' }}
  1574. GH_AW_AIC: ${{ needs.agent.outputs.aic }}
  1575. GH_AW_THREAT_DETECTION_AIC: ${{ needs.detection.outputs.aic }}
  1576. GH_AW_DETECTION_JOB_RESULT: ${{ needs.detection.result }}
  1577. GH_AW_MAX_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_AI_CREDITS || '1000' }}
  1578. GH_AW_DEFAULT_CHECKOUT_USES_TRIGGER_REF: "true"
  1579. GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }}
  1580. GH_AW_MCP_POLICY_ERROR: ${{ needs.agent.outputs.mcp_policy_error }}
  1581. GH_AW_AGENTIC_ENGINE_TIMEOUT: ${{ needs.agent.outputs.agentic_engine_timeout }}
  1582. GH_AW_MODEL_NOT_SUPPORTED_ERROR: ${{ needs.agent.outputs.model_not_supported_error }}
  1583. GH_AW_MODEL_ENDPOINT_MISMATCH_ERROR: ${{ needs.agent.outputs.model_endpoint_mismatch_error }}
  1584. GH_AW_HTTP_400_RESPONSE_ERROR: ${{ needs.agent.outputs.http_400_response_error }}
  1585. GH_AW_MAX_CACHE_MISSES_EXCEEDED: ${{ needs.agent.outputs.max_cache_misses_exceeded }}
  1586. GH_AW_MISSING_MODEL_PRICING_ERROR: ${{ needs.agent.outputs.missing_model_pricing_error }}
  1587. GH_AW_MISSING_MODEL_PRICING_MODEL_NAME: ${{ needs.agent.outputs.missing_model_pricing_model_name }}
  1588. GH_AW_SHELL_EXPANSION_GUARD_REJECTED: ${{ needs.agent.outputs.shell_expansion_guard_rejected }}
  1589. GH_AW_ENGINE_API_HOSTS: "ai-pixel.online"
  1590. GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }}
  1591. GH_AW_OAUTH_TOKEN_CHECK_FAILED: ${{ needs.activation.outputs.oauth_token_check_failed }}
  1592. GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }}
  1593. GH_AW_DAILY_AI_CREDITS_EXCEEDED: ${{ needs.activation.outputs.daily_ai_credits_exceeded }}
  1594. GH_AW_DAILY_AI_CREDITS_GUARDRAIL_STATUS: ${{ needs.activation.outputs.daily_ai_credits_guardrail_status }}
  1595. GH_AW_DAILY_AI_CREDITS_GUARDRAIL_ERROR: ${{ needs.activation.outputs.daily_ai_credits_guardrail_error }}
  1596. GH_AW_DAILY_AI_CREDITS_TOTAL: ${{ needs.activation.outputs.daily_ai_credits_total }}
  1597. GH_AW_DAILY_AI_CREDITS_ESTIMATED: ${{ needs.activation.outputs.daily_ai_credits_estimated }}
  1598. GH_AW_DAILY_AI_CREDITS_THRESHOLD: ${{ needs.activation.outputs.daily_ai_credits_threshold }}
  1599. GH_AW_DAILY_AI_CREDITS_CONTINUE_ON_ERROR: "false"
  1600. GH_AW_GROUP_REPORTS: "false"
  1601. GH_AW_FAILURE_REPORT_AS_ISSUE: "true"
  1602. GH_AW_MISSING_TOOL_REPORT_AS_FAILURE: "true"
  1603. GH_AW_MISSING_DATA_REPORT_AS_FAILURE: "true"
  1604. GH_AW_TIMEOUT_MINUTES: "15"
  1605. with:
  1606. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1607. script: |
  1608. const path = require('path');
  1609. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1610. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1611. setupGlobals(core, github, context, exec, io, getOctokit);
  1612. const { main } = require(path.join(actionsDir, 'handle_agent_failure.cjs'));
  1613. await main();
  1614. - name: Report failed jobs
  1615. id: report_failed_jobs
  1616. if: always()
  1617. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1618. env:
  1619. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1620. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  1621. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-handle-question.md"
  1622. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1623. GH_AW_REPORT_FAILED_JOBS: "true"
  1624. with:
  1625. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1626. script: |
  1627. const path = require('path');
  1628. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1629. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1630. setupGlobals(core, github, context, exec, io, getOctokit);
  1631. const { main } = require(path.join(actionsDir, 'report_failed_jobs.cjs'));
  1632. await main();
  1633. - name: Collect usage artifact files
  1634. if: always()
  1635. continue-on-error: true
  1636. env:
  1637. GH_AW_DETECTION_JOB_RESULT: ${{ needs.detection.result }}
  1638. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  1639. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  1640. run: bash "${RUNNER_TEMP}/gh-aw/actions/collect_usage_artifact_files.sh"
  1641. - name: Generate usage activity summary and unified session
  1642. if: always()
  1643. continue-on-error: true
  1644. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1645. env:
  1646. GH_AW_GRADER_MANIFEST_0: '{"version":2,"graders":[]}'
  1647. GH_AW_GRADER_MANIFEST_CHUNKS: '1'
  1648. GH_AW_JOB_DURATIONS: ${{ steps.report_failed_jobs.outputs.job_durations }}
  1649. GH_AW_DAILY_AI_CREDITS_GUARDRAIL_STATUS: ${{ needs.activation.outputs.daily_ai_credits_guardrail_status }}
  1650. GH_AW_DAILY_AI_CREDITS_EXCEEDED: ${{ needs.activation.outputs.daily_ai_credits_exceeded }}
  1651. GH_AW_DAILY_AI_CREDITS_TOTAL: ${{ needs.activation.outputs.daily_ai_credits_total }}
  1652. GH_AW_DAILY_AI_CREDITS_ESTIMATED: ${{ needs.activation.outputs.daily_ai_credits_estimated }}
  1653. GH_AW_DAILY_AI_CREDITS_THRESHOLD: ${{ needs.activation.outputs.daily_ai_credits_threshold }}
  1654. with:
  1655. script: |
  1656. const path = require('path');
  1657. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1658. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1659. setupGlobals(core, github, context, exec, io, getOctokit);
  1660. const { main } = require(path.join(actionsDir, 'generate_usage_artifacts.cjs'));
  1661. await main();
  1662. - name: Upload usage artifact
  1663. id: upload-usage-artifact
  1664. if: always()
  1665. continue-on-error: true
  1666. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  1667. with:
  1668. name: ${{ needs.activation.outputs.artifact_prefix }}usage
  1669. path: |
  1670. /tmp/gh-aw/usage/aw_session.jsonl
  1671. /tmp/gh-aw/usage/aw_info.json
  1672. /tmp/gh-aw/usage/aw-info.jsonl
  1673. /tmp/gh-aw/usage/agent_usage.json
  1674. /tmp/gh-aw/usage/agent_usage.jsonl
  1675. /tmp/gh-aw/usage/detection_usage.jsonl
  1676. /tmp/gh-aw/usage/evals.jsonl
  1677. /tmp/gh-aw/usage/graders/grader_manifest.json
  1678. /tmp/gh-aw/usage/graders/grader_results.json
  1679. /tmp/gh-aw/usage/github_rate_limits.jsonl
  1680. /tmp/gh-aw/usage/agent/token_usage.jsonl
  1681. /tmp/gh-aw/usage/agent/model-routing.jsonl
  1682. /tmp/gh-aw/usage/agent/execution.json
  1683. /tmp/gh-aw/usage/agent/harness_retry.json
  1684. /tmp/gh-aw/usage/detection/token_usage.jsonl
  1685. /tmp/gh-aw/usage/detection/execution.json
  1686. /tmp/gh-aw/usage/detection/harness_retry.json
  1687. /tmp/gh-aw/usage/detection/detection_result.json
  1688. /tmp/gh-aw/usage/evals/token_usage.jsonl
  1689. /tmp/gh-aw/usage/evals/execution.json
  1690. /tmp/gh-aw/usage/experiment/state.jsonl
  1691. /tmp/gh-aw/usage/experiment/state.json
  1692. /tmp/gh-aw/usage/experiment/assignments.json
  1693. /tmp/gh-aw/usage/activity/summary.json
  1694. if-no-files-found: ignore
  1695. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }}
  1696. - name: Wait before retrying usage artifact upload
  1697. if: always() && steps.upload-usage-artifact.outcome == 'failure'
  1698. run: sleep 10
  1699. - name: Retry upload usage artifact
  1700. id: upload-usage-artifact-retry
  1701. if: always() && steps.upload-usage-artifact.outcome == 'failure'
  1702. continue-on-error: true
  1703. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  1704. with:
  1705. name: ${{ needs.activation.outputs.artifact_prefix }}usage
  1706. path: |
  1707. /tmp/gh-aw/usage/aw_session.jsonl
  1708. /tmp/gh-aw/usage/aw_info.json
  1709. /tmp/gh-aw/usage/aw-info.jsonl
  1710. /tmp/gh-aw/usage/agent_usage.json
  1711. /tmp/gh-aw/usage/agent_usage.jsonl
  1712. /tmp/gh-aw/usage/detection_usage.jsonl
  1713. /tmp/gh-aw/usage/evals.jsonl
  1714. /tmp/gh-aw/usage/graders/grader_manifest.json
  1715. /tmp/gh-aw/usage/graders/grader_results.json
  1716. /tmp/gh-aw/usage/github_rate_limits.jsonl
  1717. /tmp/gh-aw/usage/agent/token_usage.jsonl
  1718. /tmp/gh-aw/usage/agent/model-routing.jsonl
  1719. /tmp/gh-aw/usage/agent/execution.json
  1720. /tmp/gh-aw/usage/agent/harness_retry.json
  1721. /tmp/gh-aw/usage/detection/token_usage.jsonl
  1722. /tmp/gh-aw/usage/detection/execution.json
  1723. /tmp/gh-aw/usage/detection/harness_retry.json
  1724. /tmp/gh-aw/usage/detection/detection_result.json
  1725. /tmp/gh-aw/usage/evals/token_usage.jsonl
  1726. /tmp/gh-aw/usage/evals/execution.json
  1727. /tmp/gh-aw/usage/experiment/state.jsonl
  1728. /tmp/gh-aw/usage/experiment/state.json
  1729. /tmp/gh-aw/usage/experiment/assignments.json
  1730. /tmp/gh-aw/usage/activity/summary.json
  1731. if-no-files-found: ignore
  1732. overwrite: true
  1733. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }}
  1734. detection:
  1735. name: detection
  1736. needs:
  1737. - activation
  1738. - agent
  1739. if: always() && needs.agent.result != 'skipped'
  1740. runs-on: ubuntu-latest
  1741. # Permissions for the detection job (workflow permissions default to none).
  1742. permissions:
  1743. contents: read
  1744. timeout-minutes: 10
  1745. env:
  1746. GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }}
  1747. outputs:
  1748. aic: ${{ steps.parse_detection_token_usage.outputs.aic }}
  1749. detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }}
  1750. detection_reason: ${{ steps.detection_conclusion.outputs.reason }}
  1751. detection_success: ${{ steps.detection_conclusion.outputs.success }}
  1752. run_detection: ${{ steps.detection_guard.outputs.run_detection }}
  1753. steps:
  1754. - name: Setup Scripts
  1755. id: setup
  1756. uses: github/gh-aw-actions/setup@221ba4f4319de6b8e809d1a15528b3ae6a818aa5 # v1.0.1
  1757. with:
  1758. destination: ${{ runner.temp }}/gh-aw/actions
  1759. job-name: ${{ github.job }}
  1760. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1761. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  1762. env:
  1763. GH_AW_SETUP_WORKFLOW_NAME: "Issue Handle Question"
  1764. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-handle-question.lock.yml@${{ github.ref }}
  1765. GH_AW_INFO_VERSION: "0.164.0"
  1766. GH_AW_INFO_AWF_VERSION: "v0.29.0"
  1767. GH_AW_INFO_ENGINE_ID: "codex"
  1768. GH_AW_SETUP_AW_CONTEXT: ${{ inputs.aw_context }}
  1769. - name: Download activation artifact
  1770. continue-on-error: true
  1771. uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
  1772. with:
  1773. name: ${{ needs.activation.outputs.artifact_prefix }}activation
  1774. path: /tmp/gh-aw
  1775. - name: Download agent output artifact
  1776. id: download-agent-output
  1777. continue-on-error: true
  1778. uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
  1779. with:
  1780. pattern: "{${{ needs.agent.outputs.artifact_prefix }}agent,${{ needs.agent.outputs.artifact_prefix }}agent-output-fallback}"
  1781. merge-multiple: true
  1782. path: /tmp/gh-aw/
  1783. - name: Setup agent output environment variable
  1784. id: setup-agent-output-env
  1785. if: steps.download-agent-output.outcome == 'success'
  1786. run: |
  1787. mkdir -p /tmp/gh-aw/
  1788. find "/tmp/gh-aw/" -type f -print
  1789. if [ -f "/tmp/gh-aw/agent_output.json" ]; then
  1790. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1791. fi
  1792. - name: Clear agent token usage
  1793. if: always()
  1794. run: rm -f /tmp/gh-aw/agent_usage.json
  1795. - name: Checkout repository for patch context
  1796. if: needs.agent.outputs.has_patch == 'true'
  1797. uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  1798. with:
  1799. persist-credentials: false
  1800. # --- Threat Detection ---
  1801. - name: Initialize detection execution evidence
  1802. run: |
  1803. mkdir -p "/tmp/gh-aw/threat-detection"
  1804. evidence_tmp="/tmp/gh-aw/threat-detection/execution.json.tmp"
  1805. printf '{"version":1,"component":"detection","run_id":%s,"run_attempt":%s,"state":"not_started"}\n' "$GITHUB_RUN_ID" "$GITHUB_RUN_ATTEMPT" > "$evidence_tmp"
  1806. mv "$evidence_tmp" "/tmp/gh-aw/threat-detection/execution.json"
  1807. - name: Clear inherited Copilot session state
  1808. run: rm -rf /tmp/gh-aw/sandbox/agent/logs/copilot-session-state
  1809. - name: Clean stale firewall files from agent artifact
  1810. run: |
  1811. rm -rf /tmp/gh-aw/sandbox/firewall/logs
  1812. rm -rf /tmp/gh-aw/sandbox/firewall/audit
  1813. - name: Download container images
  1814. run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.29.0@sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96 ghcr.io/github/gh-aw-firewall/api-proxy:0.29.0@sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b ghcr.io/github/gh-aw-firewall/squid:0.29.0@sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50
  1815. - name: Check if detection needed
  1816. id: detection_guard
  1817. if: always()
  1818. env:
  1819. OUTPUT_TYPES: ${{ needs.agent.outputs.output_types }}
  1820. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  1821. run: |
  1822. if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then
  1823. echo "run_detection=true" >> "$GITHUB_OUTPUT"
  1824. echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH"
  1825. else
  1826. echo "run_detection=false" >> "$GITHUB_OUTPUT"
  1827. echo "Detection skipped: no agent outputs or patches to analyze"
  1828. fi
  1829. - name: Clear MCP Config for detection
  1830. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1831. run: |
  1832. rm -f "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json"
  1833. rm -f "$HOME/.copilot/mcp-config.json"
  1834. rm -f "$GITHUB_WORKSPACE/.gemini/settings.json"
  1835. - name: Prepare threat detection files
  1836. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1837. run: |
  1838. bash "${RUNNER_TEMP}/gh-aw/actions/prepare_threat_detection_files.sh"
  1839. - name: Setup threat detection
  1840. id: detection_setup
  1841. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1842. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1843. env:
  1844. WORKFLOW_NAME: "Issue Handle Question"
  1845. WORKFLOW_DESCRIPTION: "处理分类为 question 的 issue,进行问题分析、咨询和解答"
  1846. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  1847. GH_AW_DETECTION_CONTINUE_ON_ERROR: "true"
  1848. GH_AW_DETECTION_SKIP_PROMPT_SUMMARY: "true"
  1849. with:
  1850. script: |
  1851. const path = require('path');
  1852. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  1853. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  1854. setupGlobals(core, github, context, exec, io, getOctokit);
  1855. const { main } = require(path.join(actionsDir, 'setup_threat_detection.cjs'));
  1856. await main();
  1857. - name: Ensure threat-detection directory and log
  1858. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1859. run: |
  1860. mkdir -p /tmp/gh-aw/threat-detection
  1861. touch /tmp/gh-aw/threat-detection/detection.log
  1862. - name: Install AWF binary
  1863. run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.29.0 --rootless
  1864. - name: Setup Node.js
  1865. uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
  1866. with:
  1867. node-version: '24'
  1868. package-manager-cache: false
  1869. - name: Install Codex CLI
  1870. run: npm install --ignore-scripts -g @openai/codex@0.164.0
  1871. - name: Prepare Codex config for threat-detect
  1872. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1873. run: |
  1874. mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config" "/tmp/gh-aw/mcp-config" "/tmp/gh-aw/mcp-config/logs/"
  1875. printf '%s\n' "{\"mcpServers\":{}}" > "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json"
  1876. # Point Codex at the AWF OpenAI proxy and disable websocket startup.
  1877. cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_DETECTION_CONFIG_af28c8b5454431f5_EOF
  1878. model_provider = "openai-proxy"
  1879. [history]
  1880. persistence = "none"
  1881. [model_providers.openai-proxy]
  1882. name = "OpenAI AWF proxy"
  1883. base_url = "http://172.30.0.30:10000"
  1884. api_base = "http://172.30.0.30:10000"
  1885. wss_base = "ws://172.30.0.30:10000"
  1886. env_key = "CODEX_API_KEY"
  1887. wire_api = "responses"
  1888. requires_openai_auth = false
  1889. supports_websockets = false
  1890. GH_AW_CODEX_DETECTION_CONFIG_af28c8b5454431f5_EOF
  1891. cp "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" "/tmp/gh-aw/mcp-config/config.toml"
  1892. chmod 600 "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" "/tmp/gh-aw/mcp-config/config.toml"
  1893. - name: Install threat-detect binary
  1894. id: threat_detect_install
  1895. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1896. continue-on-error: true
  1897. run: |
  1898. bash "${RUNNER_TEMP}/gh-aw/actions/install_threat_detect_binary.sh" v0.5.3 --artifact-base-url https://github.com/github/gh-aw-threat-detection/releases/download --sha256-amd64 7cfab3bd02717968a0584ddd3790cff22550059e36d6f656c4f35e9d27851009 --sha256-arm64 6f355949af98e7b5527a958ac11431bd7867db45c0191b94c3a205c662181cc6
  1899. - name: Execute threat detection with AWF
  1900. id: detection_agentic_execution
  1901. if: always() && steps.detection_guard.outputs.run_detection == 'true' && steps.detection_setup.outcome == 'success' && steps.detection_setup.outputs.ready == 'true' && steps.threat_detect_install.outcome == 'success'
  1902. continue-on-error: true
  1903. timeout-minutes: 10
  1904. env:
  1905. AWF_REFLECT_ENABLED: 1
  1906. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
  1907. CODEX_HOME: /tmp/gh-aw/mcp-config
  1908. GH_AW_HARNESS_MAX_RETRIES: 0
  1909. GH_AW_LLM_PROVIDER: openai
  1910. GH_AW_LLM_PROVIDER_EXPLICIT: 1
  1911. GH_AW_MAX_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_DETECTION_MAX_AI_CREDITS || '400' }}
  1912. GH_AW_MAX_TURNS: ${{ vars.GH_AW_DEFAULT_MAX_TURNS || '' }}
  1913. GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/config.toml
  1914. GH_AW_MODEL_DETECTION_CODEX: gpt-5.6-luna
  1915. GH_AW_PHASE: detection
  1916. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  1917. GH_AW_VERSION: v1.0.1
  1918. GITHUB_AW: true
  1919. GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
  1920. GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
  1921. GIT_AUTHOR_NAME: github-actions[bot]
  1922. GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
  1923. GIT_COMMITTER_NAME: github-actions[bot]
  1924. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1925. OPENAI_BASE_URL: https://ai-pixel.online
  1926. RUNNER_TEMP: ${{ runner.temp }}
  1927. RUST_LOG: ${{ runner.debug == 1 && 'trace,hyper_util=info,mio=info,reqwest=info,os_info=info,codex_otel=warn,codex_core=debug,codex_exec=debug' || 'warn' }}
  1928. TRACEPARENT: ${{ env.GITHUB_AW_OTEL_TRACE_ID != '' && env.GITHUB_AW_OTEL_PARENT_SPAN_ID != '' && format('00-{0}-{1}-01', env.GITHUB_AW_OTEL_TRACE_ID, env.GITHUB_AW_OTEL_PARENT_SPAN_ID) || '' }}
  1929. WORKFLOW_NAME: "Issue Handle Question"
  1930. WORKFLOW_DESCRIPTION: "处理分类为 question 的 issue,进行问题分析、咨询和解答"
  1931. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  1932. GH_AW_DETECTION_CONTINUE_ON_ERROR: "true"
  1933. run: |
  1934. mkdir -p "/tmp/gh-aw/threat-detection"
  1935. evidence_tmp="/tmp/gh-aw/threat-detection/execution.json.tmp"
  1936. printf '{"version":1,"component":"detection","run_id":%s,"run_attempt":%s,"state":"started"}\n' "$GITHUB_RUN_ID" "$GITHUB_RUN_ATTEMPT" > "$evidence_tmp"
  1937. mv "$evidence_tmp" "/tmp/gh-aw/threat-detection/execution.json"
  1938. export GH_AW_AWF_EXECUTION_COMPONENT="detection"
  1939. export GH_AW_AWF_EXECUTION_EVIDENCE_FILE="/tmp/gh-aw/threat-detection/execution.json"
  1940. set -o pipefail
  1941. printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
  1942. (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log)
  1943. GH_AW_MAX_AI_CREDITS="${GH_AW_MAX_AI_CREDITS:-400}"
  1944. if [[ ! "$GH_AW_MAX_AI_CREDITS" =~ ^[0-9]+$ ]]; then
  1945. GH_AW_MAX_AI_CREDITS="400"
  1946. fi
  1947. if [[ "${GH_AW_ADMISSION_RESULT:-}" == "admitted" && -n "${GH_AW_ADMISSION_MAX_AI_CREDITS:-}" ]]; then
  1948. if [[ ! "$GH_AW_ADMISSION_MAX_AI_CREDITS" =~ ^[1-9][0-9]{0,9}$ ]] || (( GH_AW_ADMISSION_MAX_AI_CREDITS > 2147483647 )); then
  1949. echo "ERR_ADMISSION: Invalid runtime admission allowance." >&2
  1950. exit 1
  1951. fi
  1952. GH_AW_MAX_AI_CREDITS="$GH_AW_ADMISSION_MAX_AI_CREDITS"
  1953. echo "Admission allowance applied (value withheld)."
  1954. else
  1955. echo "No component admission allowance; retaining existing budget policy (value withheld)."
  1956. fi
  1957. unset GH_AW_ADMISSION_RESULT GH_AW_ADMISSION_MAX_AI_CREDITS
  1958. printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.29.0/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"172.30.0.1\",\"ai-pixel.online\",\"api-inference.modelscope.cn\",\"api.commandcode.ai\",\"api.deepseek.com\",\"api.github.com\",\"api.minimaxi.com\",\"api.openai.com\",\"github.com\",\"host.docker.internal\",\"open.bigmodel.cn\",\"opencode.ai\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"modelFallback\":{\"enabled\":false},\"targets\":{\"openai\":{\"host\":\"ai-pixel.online\"}},\"providers\":{\"openai\":{\"models\":{\"gpt-5.6-luna\":{\"cost\":{\"cache_read\":\"2e-08\",\"cache_write\":\"2.5e-07\",\"input\":\"2e-07\",\"output\":\"1.2e-06\"}}}}},\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-6\",\"gpt-5.4\",\"gpt-5.5\",\"gpt-5.6\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"auto\":[\"copilot/auto\",\"large\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"detection\":[\"small\"],\"evals\":[\"small\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-3.6-flash\":[\"copilot/gemini-3.6*flash*\",\"google/gemini-3.6*flash*\",\"gemini/gemini-3.6*flash*\"],\"gemini-3.7-flash\":[\"copilot/gemini-3.7*flash*\",\"google/gemini-3.7*flash*\",\"gemini/gemini-3.7*flash*\"],\"gemini-3.8-flash\":[\"copilot/gemini-3.8*flash*\",\"google/gemini-3.8*flash*\",\"gemini/gemini-3.8*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"gpt-6\":[\"copilot/gpt-6*\",\"openai/gpt-6*\"],\"grok\":[\"copilot/*grok*\",\"openai/*grok*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"sonnet\",\"gpt-6\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"raptor-mini\":[\"copilot/raptor*\",\"openai/raptor*\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-5*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\",\"anthropic/*sonnet-5*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.29.0,squid=sha256:6e0cbf7f980beb78b5461563a8164f6439ca959bc93733d5a6b52972e523ed50,agent=sha256:b14bd399376180b5649a9324be3b50fbfc82bfe8f0c80045840416b5a4e65b96,api-proxy=sha256:baff00b856a4bdc93bce134928c70af3d3492f2e518757115042040674d56b0b,cli-proxy=sha256:087a8e4efff8ac62d46e106cd22005c002822b1481fc233097799511be353b5d\",\"agentTimeout\":10},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
  1959. cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
  1960. export GH_AW_MODELS_JSON_PATH="/tmp/gh-aw/models.json"
  1961. GH_AW_DOCKER_HOST=""
  1962. if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then
  1963. GH_AW_DOCKER_HOST="${DOCKER_HOST}"
  1964. fi
  1965. if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then
  1966. _GH_AW_CHROOT_JSON=$(jq -c --arg src "${RUNNER_TEMP}/gh-aw" --arg user "$(id -un)" --argjson uid "$(id -u)" --argjson gid "$(id -g)" --arg home "${RUNNER_TEMP}/gh-aw/home" '.chroot={"binariesSourcePath":$src,"identity":{"user":$user,"uid":$uid,"gid":$gid,"home":$home}}' "${RUNNER_TEMP}/gh-aw/awf-config.json") || { echo "chroot config patch failed" >&2; exit 1; }
  1967. printf '%s\n' "$_GH_AW_CHROOT_JSON" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
  1968. fi
  1969. GH_AW_TOOL_CACHE_MOUNT=""
  1970. GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:?RUNNER_TOOL_CACHE must be set}"
  1971. if [ -d "$GH_AW_TOOL_CACHE" ]; then
  1972. if [[ "$GH_AW_TOOL_CACHE" != /opt/* ]]; then
  1973. GH_AW_TOOL_CACHE_MOUNT="$GH_AW_TOOL_CACHE:$GH_AW_TOOL_CACHE:ro"
  1974. fi
  1975. fi
  1976. # shellcheck disable=SC1003,SC2016,SC2086
  1977. awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" ${GH_AW_TOOL_CACHE_MOUNT:+--mount "$GH_AW_TOOL_CACHE_MOUNT"} ${GH_AW_DOCKER_HOST:+--docker-host "$GH_AW_DOCKER_HOST"} --env-all --exclude-env ACTIONS_ID_TOKEN_REQUEST_TOKEN --exclude-env ACTIONS_ID_TOKEN_REQUEST_URL --exclude-env CODEX_API_KEY --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GH_AW_OTLP_ALL_HEADERS --exclude-env GH_AW_OTLP_ENDPOINTS --exclude-env OPENAI_API_KEY --exclude-env OTEL_EXPORTER_OTLP_ENDPOINT --exclude-env OTEL_EXPORTER_OTLP_HEADERS --mount /tmp/gh-aw:/tmp/gh-aw:rw --mount /tmp/gh-aw/threat-detection:/tmp/gh-aw/threat-detection:rw --log-level info --skip-pull \
  1978. -- /bin/bash -c 'set +o histexpand; : "${RUNNER_TOOL_CACHE:?RUNNER_TOOL_CACHE must be set}"; GH_AW_TOOL_CACHE="$RUNNER_TOOL_CACHE"; GH_AW_TOOL_BINS="$(find "$GH_AW_TOOL_CACHE" -maxdepth 5 -type d -name bin 2>/dev/null | tr "\n" ":")"; GH_AW_TOOL_BINS="${GH_AW_TOOL_BINS%:}"; export PATH="$PATH${GH_AW_TOOL_BINS:+:}$GH_AW_TOOL_BINS"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true; [ -n "$ERLANG_HOME" ] && export PATH="$ERLANG_HOME/bin:$PATH" || true && threat-detect --engine codex --output /tmp/gh-aw/threat-detection/detection_result.json /tmp/gh-aw/threat-detection' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log
  1979. - name: Copy detection firewall logs
  1980. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1981. continue-on-error: true
  1982. run: |
  1983. mkdir -p /tmp/gh-aw/threat-detection/sandbox/firewall
  1984. if [ -d /tmp/gh-aw/sandbox/firewall/logs ]; then mkdir -p /tmp/gh-aw/threat-detection/sandbox/firewall/logs && cp -r /tmp/gh-aw/sandbox/firewall/logs/. /tmp/gh-aw/threat-detection/sandbox/firewall/logs/; fi
  1985. if [ -d /tmp/gh-aw/sandbox/firewall/audit ]; then mkdir -p /tmp/gh-aw/threat-detection/sandbox/firewall/audit && cp -r /tmp/gh-aw/sandbox/firewall/audit/. /tmp/gh-aw/threat-detection/sandbox/firewall/audit/; fi
  1986. - name: Redact secrets in detection logs
  1987. id: redact_detection_logs
  1988. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1989. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1990. env:
  1991. GH_AW_SECRET_NAMES: 'CODEX_API_KEY,GH_AW_DEFAULT_OTLP_ENDPOINT,GH_AW_DEFAULT_OTLP_HEADERS,OPENAI_API_KEY,PIXEL_API_KEY'
  1992. SECRET_CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  1993. SECRET_GH_AW_DEFAULT_OTLP_ENDPOINT: ${{ secrets.GH_AW_DEFAULT_OTLP_ENDPOINT }}
  1994. SECRET_GH_AW_DEFAULT_OTLP_HEADERS: ${{ secrets.GH_AW_DEFAULT_OTLP_HEADERS }}
  1995. SECRET_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  1996. SECRET_PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1997. with:
  1998. script: |
  1999. const path = require('path');
  2000. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  2001. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  2002. setupGlobals(core, github, context, exec, io, getOctokit);
  2003. const { main } = require(path.join(actionsDir, 'redact_secrets.cjs'));
  2004. const { persistDetectionMasks } = require(path.join(actionsDir, 'detection_mask_state.cjs'));
  2005. await main({ additionalDirectories: ["/tmp/gh-aw/threat-detection/sandbox/firewall"], persistDetectionMasks });
  2006. - name: Parse threat detection token usage for step summary
  2007. id: parse_detection_token_usage
  2008. if: always() && steps.detection_guard.outputs.run_detection == 'true' && steps.redact_detection_logs.outcome == 'success'
  2009. continue-on-error: true
  2010. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  2011. env:
  2012. GH_AW_TOKEN_USAGE_SUMMARY_TITLE: Threat Detection Token Usage
  2013. GH_AW_PHASE: detection
  2014. GH_AW_AGENT_USAGE_PATH: /tmp/gh-aw/threat-detection/detection_usage.json
  2015. GH_AW_AGENT_USAGE_JSONL_PATH: /tmp/gh-aw/threat-detection/detection_usage.jsonl
  2016. GH_AW_WRITE_EMPTY_USAGE: "true"
  2017. with:
  2018. script: |
  2019. const path = require('path');
  2020. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  2021. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  2022. setupGlobals(core, github, context, exec, io, getOctokit);
  2023. const { main } = require(path.join(actionsDir, 'parse_token_usage.cjs'));
  2024. await main();
  2025. - name: Redact secrets in detection artifacts
  2026. id: redact_detection_artifacts
  2027. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  2028. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  2029. env:
  2030. GH_AW_SECRET_NAMES: 'CODEX_API_KEY,GH_AW_DEFAULT_OTLP_ENDPOINT,GH_AW_DEFAULT_OTLP_HEADERS,OPENAI_API_KEY,PIXEL_API_KEY'
  2031. SECRET_CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  2032. SECRET_GH_AW_DEFAULT_OTLP_ENDPOINT: ${{ secrets.GH_AW_DEFAULT_OTLP_ENDPOINT }}
  2033. SECRET_GH_AW_DEFAULT_OTLP_HEADERS: ${{ secrets.GH_AW_DEFAULT_OTLP_HEADERS }}
  2034. SECRET_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  2035. SECRET_PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  2036. with:
  2037. script: |
  2038. const path = require('path');
  2039. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  2040. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  2041. setupGlobals(core, github, context, exec, io, getOctokit);
  2042. const { main } = require(path.join(actionsDir, 'redact_secrets.cjs'));
  2043. const { persistDetectionMasks } = require(path.join(actionsDir, 'detection_mask_state.cjs'));
  2044. await main({ additionalDirectories: ["/tmp/gh-aw/threat-detection/sandbox/firewall"], persistDetectionMasks });
  2045. - name: Render detection log
  2046. if: always() && steps.detection_guard.outputs.run_detection == 'true' && steps.redact_detection_logs.outcome == 'success' && steps.redact_detection_artifacts.outcome == 'success'
  2047. continue-on-error: true
  2048. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  2049. with:
  2050. script: |
  2051. const path = require('path');
  2052. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  2053. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  2054. setupGlobals(core, github, context, exec, io, getOctokit);
  2055. const { main } = require(path.join(actionsDir, 'render_detection_log.cjs'));
  2056. await main();
  2057. - name: Upload threat detection artifact
  2058. if: always() && steps.detection_guard.outputs.run_detection == 'true' && steps.redact_detection_logs.outcome == 'success' && steps.redact_detection_artifacts.outcome == 'success'
  2059. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  2060. with:
  2061. name: ${{ needs.agent.outputs.artifact_prefix }}detection
  2062. path: |
  2063. /tmp/gh-aw/threat-detection/detection_result.json
  2064. /tmp/gh-aw/threat-detection/execution.json
  2065. /tmp/gh-aw/threat-detection/detection_usage.json
  2066. /tmp/gh-aw/threat-detection/detection_usage.jsonl
  2067. /tmp/gh-aw/threat-detection/sandbox/firewall/logs/
  2068. /tmp/gh-aw/threat-detection/sandbox/firewall/audit/
  2069. if-no-files-found: ignore
  2070. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }}
  2071. - name: Conclude threat detection
  2072. id: detection_conclusion
  2073. if: always() && steps.detection_guard.outputs.run_detection == 'false' || (always() && steps.detection_guard.outputs.run_detection == 'true' && steps.redact_detection_logs.outcome == 'success' && steps.redact_detection_artifacts.outcome == 'success')
  2074. continue-on-error: true
  2075. env:
  2076. RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
  2077. DETECTION_AGENTIC_EXECUTION_OUTCOME: ${{ steps.detection_agentic_execution.outcome }}
  2078. THREAT_DETECT_INSTALL_OUTCOME: ${{ steps.threat_detect_install.outcome }}
  2079. GH_AW_DETECTION_CONTINUE_ON_ERROR: "true"
  2080. run: |
  2081. bash "${RUNNER_TEMP}/gh-aw/actions/conclude_threat_detection.sh" /tmp/gh-aw/threat-detection/detection_result.json
  2082. - name: Upload skipped detection execution evidence
  2083. if: always() && steps.detection_guard.outputs.run_detection == 'false'
  2084. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  2085. with:
  2086. name: ${{ needs.agent.outputs.artifact_prefix }}detection
  2087. path: /tmp/gh-aw/threat-detection/execution.json
  2088. if-no-files-found: ignore
  2089. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }}
  2090. safe_outputs:
  2091. name: safe_outputs
  2092. needs:
  2093. - activation
  2094. - agent
  2095. - detection
  2096. if: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success'
  2097. runs-on: ubuntu-slim
  2098. # Permissions for the safe_outputs job (workflow permissions default to none).
  2099. permissions:
  2100. issues: write
  2101. pull-requests: write
  2102. timeout-minutes: 15
  2103. env:
  2104. GH_AW_AGENT_AIC: ${{ needs.agent.outputs.aic }}
  2105. GH_AW_AIC: ${{ needs.agent.outputs.aic }}
  2106. GH_AW_AMBIENT_CONTEXT: ${{ needs.agent.outputs.ambient_context }}
  2107. GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/issue-handle-question"
  2108. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  2109. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  2110. GH_AW_ENGINE_ID: "codex"
  2111. GH_AW_ENGINE_MODEL: "gpt-5.6-luna"
  2112. GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }}
  2113. GH_AW_RUN_DETECTION: ${{ needs.detection.outputs.run_detection }}
  2114. GH_AW_THREAT_DETECTION_AIC: ${{ needs.detection.outputs.aic }}
  2115. GH_AW_WORKFLOW_ID: "issue-handle-question"
  2116. GH_AW_WORKFLOW_NAME: "Issue Handle Question"
  2117. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-handle-question.md"
  2118. outputs:
  2119. code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }}
  2120. code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }}
  2121. comment_id: ${{ steps.process_safe_outputs.outputs.comment_id }}
  2122. comment_url: ${{ steps.process_safe_outputs.outputs.comment_url }}
  2123. create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}
  2124. create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}
  2125. process_safe_outputs_items_applied: ${{ steps.process_safe_outputs.outputs.items_applied }}
  2126. process_safe_outputs_items_cancelled: ${{ steps.process_safe_outputs.outputs.items_cancelled }}
  2127. process_safe_outputs_items_deferred: ${{ steps.process_safe_outputs.outputs.items_deferred }}
  2128. process_safe_outputs_items_failed: ${{ steps.process_safe_outputs.outputs.items_failed }}
  2129. process_safe_outputs_items_skipped: ${{ steps.process_safe_outputs.outputs.items_skipped }}
  2130. process_safe_outputs_items_succeeded: ${{ steps.process_safe_outputs.outputs.items_succeeded }}
  2131. process_safe_outputs_items_warnings: ${{ steps.process_safe_outputs.outputs.items_warnings }}
  2132. process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
  2133. process_safe_outputs_status: ${{ steps.process_safe_outputs.outputs.status }}
  2134. steps:
  2135. - name: Setup Scripts
  2136. id: setup
  2137. uses: github/gh-aw-actions/setup@221ba4f4319de6b8e809d1a15528b3ae6a818aa5 # v1.0.1
  2138. with:
  2139. destination: ${{ runner.temp }}/gh-aw/actions
  2140. job-name: ${{ github.job }}
  2141. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  2142. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  2143. env:
  2144. GH_AW_SETUP_WORKFLOW_NAME: "Issue Handle Question"
  2145. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-handle-question.lock.yml@${{ github.ref }}
  2146. GH_AW_INFO_VERSION: "0.164.0"
  2147. GH_AW_INFO_AWF_VERSION: "v0.29.0"
  2148. GH_AW_INFO_ENGINE_ID: "codex"
  2149. GH_AW_SETUP_AW_CONTEXT: ${{ inputs.aw_context }}
  2150. - name: Mask OTLP telemetry headers
  2151. run: bash "${RUNNER_TEMP}/gh-aw/actions/mask_otlp_headers.sh"
  2152. - name: Download agent output artifact
  2153. id: download-agent-output
  2154. continue-on-error: true
  2155. uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
  2156. with:
  2157. pattern: "{${{ needs.activation.outputs.artifact_prefix }}agent,${{ needs.activation.outputs.artifact_prefix }}agent-output-fallback}"
  2158. merge-multiple: true
  2159. path: /tmp/gh-aw/
  2160. - name: Setup agent output environment variable
  2161. id: setup-agent-output-env
  2162. if: steps.download-agent-output.outcome == 'success'
  2163. run: |
  2164. mkdir -p /tmp/gh-aw/
  2165. find "/tmp/gh-aw/" -type f -print
  2166. if [ -f "/tmp/gh-aw/agent_output.json" ]; then
  2167. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  2168. fi
  2169. - name: Configure GH_HOST for enterprise compatibility
  2170. id: ghes-host-config
  2171. shell: bash
  2172. run: | # zizmor: ignore[github-env] - GITHUB_SERVER_URL is set by GitHub Actions, not user input.
  2173. # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct
  2174. # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op.
  2175. GH_HOST="${GITHUB_SERVER_URL#https://}"
  2176. GH_HOST="${GH_HOST#http://}"
  2177. echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV"
  2178. - name: Process Safe Outputs
  2179. id: process_safe_outputs
  2180. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  2181. env:
  2182. GH_AW_JOB_CHECK_RUN_ID: ${{ job.check_run_id }}
  2183. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  2184. GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
  2185. GH_AW_MENTIONS_GITHUB_TOKEN: ${{ github.token }}
  2186. GH_AW_ALLOWED_DOMAINS: "ai-pixel.online,api-inference.modelscope.cn,api.commandcode.ai,api.deepseek.com,api.minimaxi.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,open.bigmodel.cn,opencode.ai,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,s.symcb.com,s.symcd.com,security.ubuntu.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com"
  2187. GITHUB_SERVER_URL: ${{ github.server_url }}
  2188. GITHUB_API_URL: ${{ github.api_url }}
  2189. GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1,\"target\":\"${{ inputs.issue_number }}\"},\"add_labels\":{\"max\":3,\"target\":\"${{ inputs.issue_number }}\"},\"create_report_incomplete_issue\":{},\"noop\":{\"max\":2,\"report-as-issue\":\"false\"},\"report_incomplete\":{},\"report_missing_data\":{},\"report_missing_tool\":{},\"update_issue\":{\"allow_body\":true,\"max\":1,\"target\":\"${{ inputs.issue_number }}\"}}"
  2190. GH_AW_GITHUB_TOKEN_SOURCE: ${{ secrets.GH_AW_GITHUB_TOKEN != '' && 'pat' || 'github_actions' }}
  2191. with:
  2192. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  2193. script: |
  2194. const path = require('path');
  2195. const actionsDir = path.join(process.env.RUNNER_TEMP, 'gh-aw', 'actions');
  2196. const { setupGlobals } = require(path.join(actionsDir, 'setup_globals.cjs'));
  2197. setupGlobals(core, github, context, exec, io, getOctokit, process.env.GH_AW_GITHUB_TOKEN_SOURCE);
  2198. const { main } = require(path.join(actionsDir, 'process_safe_outputs.cjs'));
  2199. await main();
  2200. - name: Upload Safe Outputs Items
  2201. if: always()
  2202. uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  2203. with:
  2204. name: ${{ needs.activation.outputs.artifact_prefix }}safe-outputs-items
  2205. path: |
  2206. /tmp/gh-aw/safe-output-items.jsonl
  2207. /tmp/gh-aw/safe-output-outcomes.jsonl
  2208. /tmp/gh-aw/temporary-id-map.json
  2209. /tmp/gh-aw/safe-output-errors.json
  2210. if-no-files-found: ignore
  2211. retention-days: ${{ vars.GH_AW_DEFAULT_ARTIFACT_RETENTION_DAYS || '0' }}