issue-triage.lock.yml 111 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872
  1. # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"d97ec983e46af9c19acaeff0a0c1e66f28ea71844285f8fa3db1a46f02757fec","body_hash":"a7dd6dc846c988e38b3e0292da02e0796f06da1e92c9fda5fb4724b52fd5c290","compiler_version":"v0.79.4","strict":true,"agent_id":"codex","agent_model":"gpt-5.4","engine_versions":{"codex":"0.137.0"}}
  2. # gh-aw-manifest: {"version":1,"secrets":["CODEX_API_KEY","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","OPENAI_API_KEY","PIXEL_API_KEY"],"actions":[{"repo":"actions/checkout","sha":"df4cb1c069e1874edd31b4311f1884172cec0e10","version":"v6.0.3"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"7cfd95b59ca996b7e2bebd6222e21ddd187a4e91","version":"v0.79.4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.0"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.0"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.25","digest":"sha256:c10331ad17668ef89f38f5e356678788a40b0cd5fef96e8f92e1d9c1de47cbaa","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.25@sha256:c10331ad17668ef89f38f5e356678788a40b0cd5fef96e8f92e1d9c1de47cbaa"},{"image":"ghcr.io/github/github-mcp-server:v1.1.2","digest":"sha256:30197479d8036c7811892bc07e06f9a05c9ef3cdd79bc59f256d50647f95788c","pinned_image":"ghcr.io/github/github-mcp-server:v1.1.2@sha256:30197479d8036c7811892bc07e06f9a05c9ef3cdd79bc59f256d50647f95788c"},{"image":"node:lts-alpine","digest":"sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14","pinned_image":"node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14"}]}
  3. # ___ _ _
  4. # / _ \ | | (_)
  5. # | |_| | __ _ ___ _ __ | |_ _ ___
  6. # | _ |/ _` |/ _ \ '_ \| __| |/ __|
  7. # | | | | (_| | __/ | | | |_| | (__
  8. # \_| |_/\__, |\___|_| |_|\__|_|\___|
  9. # __/ |
  10. # _ _ |___/
  11. # | | | | / _| |
  12. # | | | | ___ _ __ _ __| |_| | _____ ____
  13. # | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___|
  14. # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
  15. # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
  16. #
  17. # This file was automatically generated by gh-aw (v0.79.4). DO NOT EDIT.
  18. #
  19. # To update this file, edit the corresponding .md file and run:
  20. # gh aw compile
  21. # Not all edits will cause changes to this file.
  22. #
  23. # For more information: https://github.github.com/gh-aw/introduction/overview/
  24. #
  25. # 对新打开的 issue 进行分类、打标签,并路由到对应的处理工作流
  26. #
  27. # Resolved workflow manifest:
  28. # Imports:
  29. # - shared/engine.md
  30. # - shared/network.md
  31. #
  32. # Secrets used:
  33. # - CODEX_API_KEY
  34. # - GH_AW_GITHUB_MCP_SERVER_TOKEN
  35. # - GH_AW_GITHUB_TOKEN
  36. # - GITHUB_TOKEN
  37. # - OPENAI_API_KEY
  38. # - PIXEL_API_KEY
  39. #
  40. # Custom actions used:
  41. # - actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
  42. # - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  43. # - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  44. # - actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
  45. # - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  46. # - github/gh-aw-actions/setup@7cfd95b59ca996b7e2bebd6222e21ddd187a4e91 # v0.79.4
  47. #
  48. # Container images used:
  49. # - ghcr.io/github/gh-aw-firewall/agent:0.27.0
  50. # - ghcr.io/github/gh-aw-firewall/api-proxy:0.27.0
  51. # - ghcr.io/github/gh-aw-firewall/squid:0.27.0
  52. # - ghcr.io/github/gh-aw-mcpg:v0.3.25@sha256:c10331ad17668ef89f38f5e356678788a40b0cd5fef96e8f92e1d9c1de47cbaa
  53. # - ghcr.io/github/github-mcp-server:v1.1.2@sha256:30197479d8036c7811892bc07e06f9a05c9ef3cdd79bc59f256d50647f95788c
  54. # - node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14
  55. name: "Issue Triage"
  56. on:
  57. issues:
  58. types:
  59. - opened
  60. - reopened
  61. # roles: all # Roles processed as role check in pre-activation job
  62. workflow_dispatch:
  63. inputs:
  64. aw_context:
  65. default: ""
  66. description: "Agent caller context (used internally by Agentic Workflows)."
  67. required: false
  68. type: string
  69. issue_number:
  70. description: 要分类的 issue 编号
  71. required: true
  72. type: string
  73. permissions: {}
  74. concurrency:
  75. group: "gh-aw-${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}"
  76. run-name: "Issue Triage"
  77. jobs:
  78. activation:
  79. runs-on: ubuntu-slim
  80. permissions:
  81. actions: read
  82. contents: read
  83. env:
  84. GH_AW_MAX_DAILY_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS || '5000' }}
  85. outputs:
  86. body: ${{ steps.sanitized.outputs.body }}
  87. comment_id: ""
  88. comment_repo: ""
  89. daily_effective_workflow_exceeded: ${{ steps.daily-effective-workflow-guardrail.outputs.daily_effective_workflow_exceeded == 'true' }}
  90. daily_effective_workflow_threshold: ${{ steps.daily-effective-workflow-guardrail.outputs.daily_effective_workflow_threshold || '' }}
  91. daily_effective_workflow_total_effective_tokens: ${{ steps.daily-effective-workflow-guardrail.outputs.daily_effective_workflow_total_effective_tokens || '' }}
  92. engine_id: ${{ steps.generate_aw_info.outputs.engine_id }}
  93. lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }}
  94. model: ${{ steps.generate_aw_info.outputs.model }}
  95. secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }}
  96. setup-parent-span-id: ${{ steps.setup.outputs.parent-span-id || steps.setup.outputs.span-id }}
  97. setup-span-id: ${{ steps.setup.outputs.span-id }}
  98. setup-trace-id: ${{ steps.setup.outputs.trace-id }}
  99. stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }}
  100. text: ${{ steps.sanitized.outputs.text }}
  101. title: ${{ steps.sanitized.outputs.title }}
  102. steps:
  103. - name: Setup Scripts
  104. id: setup
  105. uses: github/gh-aw-actions/setup@7cfd95b59ca996b7e2bebd6222e21ddd187a4e91 # v0.79.4
  106. with:
  107. destination: ${{ runner.temp }}/gh-aw/actions
  108. job-name: ${{ github.job }}
  109. safe-output-artifact-client: ${{ env.GH_AW_MAX_DAILY_AI_CREDITS != '' }}
  110. env:
  111. GH_AW_SETUP_WORKFLOW_NAME: "Issue Triage"
  112. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-triage.lock.yml@${{ github.ref }}
  113. GH_AW_INFO_VERSION: "0.137.0"
  114. GH_AW_INFO_AWF_VERSION: "v0.27.0"
  115. GH_AW_INFO_ENGINE_ID: "codex"
  116. - name: Generate agentic run info
  117. id: generate_aw_info
  118. env:
  119. GH_AW_INFO_ENGINE_ID: "codex"
  120. GH_AW_INFO_ENGINE_NAME: "Codex"
  121. GH_AW_INFO_MODEL: "gpt-5.4"
  122. GH_AW_INFO_VERSION: "0.137.0"
  123. GH_AW_INFO_AGENT_VERSION: "0.137.0"
  124. GH_AW_INFO_CLI_VERSION: "v0.79.4"
  125. GH_AW_INFO_WORKFLOW_NAME: "Issue Triage"
  126. GH_AW_INFO_EXPERIMENTAL: "false"
  127. GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true"
  128. GH_AW_INFO_STAGED: "false"
  129. 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"]'
  130. GH_AW_INFO_FIREWALL_ENABLED: "true"
  131. GH_AW_INFO_AWF_VERSION: "v0.27.0"
  132. GH_AW_INFO_AWMG_VERSION: ""
  133. GH_AW_INFO_FIREWALL_TYPE: "squid"
  134. GH_AW_COMPILED_STRICT: "true"
  135. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  136. with:
  137. script: |
  138. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  139. setupGlobals(core, github, context, exec, io, getOctokit);
  140. const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_aw_info.cjs');
  141. await main(core, context);
  142. - name: Check daily workflow token guardrail
  143. id: daily-effective-workflow-guardrail
  144. if: ${{ env.GH_AW_MAX_DAILY_AI_CREDITS != '' }}
  145. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  146. env:
  147. GH_AW_WORKFLOW_NAME: "Issue Triage"
  148. GH_AW_WORKFLOW_ID: "issue-triage"
  149. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  150. GH_AW_WORKFLOW_DISPATCH_AW_CONTEXT: ${{ github.event.inputs.aw_context || '' }}
  151. GH_AW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  152. GH_AW_MAX_DAILY_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS || '5000' }}
  153. with:
  154. github-token: ${{ secrets.GITHUB_TOKEN }}
  155. script: |
  156. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  157. setupGlobals(core, github, context, exec, io, getOctokit);
  158. const { main } = require('${{ runner.temp }}/gh-aw/actions/check_daily_aic_workflow_guardrail.cjs');
  159. await main();
  160. - name: Validate CODEX_API_KEY or OPENAI_API_KEY secret
  161. id: validate-secret
  162. 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
  163. env:
  164. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  165. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  166. - name: Checkout .github and .agents folders
  167. uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
  168. with:
  169. persist-credentials: false
  170. sparse-checkout: |
  171. .github
  172. .agents
  173. .antigravity
  174. .claude
  175. .codex
  176. .crush
  177. .gemini
  178. .opencode
  179. .pi
  180. sparse-checkout-cone-mode: true
  181. fetch-depth: 1
  182. - name: Save agent config folders for base branch restoration
  183. env:
  184. GH_AW_AGENT_FOLDERS: ".agents .antigravity .claude .codex .crush .gemini .github .opencode .pi"
  185. GH_AW_AGENT_FILES: ".crush.json AGENTS.md ANTIGRAVITY.md CLAUDE.md GEMINI.md PI.md opencode.jsonc"
  186. # poutine:ignore untrusted_checkout_exec
  187. run: bash "${RUNNER_TEMP}/gh-aw/actions/save_base_github_folders.sh"
  188. - name: Check workflow lock file
  189. id: check-lock-file
  190. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  191. env:
  192. GH_AW_WORKFLOW_FILE: "issue-triage.lock.yml"
  193. GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}"
  194. with:
  195. script: |
  196. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  197. setupGlobals(core, github, context, exec, io, getOctokit);
  198. const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs');
  199. await main();
  200. - name: Check compile-agentic version
  201. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  202. env:
  203. GH_AW_COMPILED_VERSION: "v0.79.4"
  204. with:
  205. script: |
  206. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  207. setupGlobals(core, github, context, exec, io, getOctokit);
  208. const { main } = require('${{ runner.temp }}/gh-aw/actions/check_version_updates.cjs');
  209. await main();
  210. - name: Compute current body text
  211. id: sanitized
  212. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  213. env:
  214. GH_AW_ALLOWED_DOMAINS: "172.30.0.1,ai-pixel.online,api-inference.modelscope.cn,api.commandcode.ai,api.deepseek.com,api.minimaxi.com,api.openai.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,chatgpt.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,host.docker.internal,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,openai.com,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"
  215. with:
  216. script: |
  217. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  218. setupGlobals(core, github, context, exec, io, getOctokit);
  219. const { main } = require('${{ runner.temp }}/gh-aw/actions/compute_text.cjs');
  220. await main();
  221. - name: Create prompt with built-in context
  222. env:
  223. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  224. GH_AW_SAFE_OUTPUTS: ${{ runner.temp }}/gh-aw/safeoutputs/outputs.jsonl
  225. GH_AW_EXPR_1A3A194A: ${{ github.event.discussion.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'discussion' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }}
  226. GH_AW_EXPR_463A214A: ${{ github.event.pull_request.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'pull_request' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }}
  227. GH_AW_EXPR_54492A5B: ${{ github.event.issue.number || inputs.issue_number }}
  228. GH_AW_EXPR_802A9F6A: ${{ github.event.issue.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'issue' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }}
  229. GH_AW_EXPR_FF1D34CE: ${{ github.event.comment.id || fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').comment_id }}
  230. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  231. GH_AW_GITHUB_EVENT_ISSUE_TITLE: ${{ github.event.issue.title }}
  232. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  233. GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
  234. GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
  235. GH_AW_INPUTS_ISSUE_NUMBER: ${{ inputs.issue_number }}
  236. # poutine:ignore untrusted_checkout_exec
  237. run: |
  238. bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh"
  239. {
  240. cat << 'GH_AW_PROMPT_9e10a58f1e12d9c2_EOF'
  241. <system>
  242. GH_AW_PROMPT_9e10a58f1e12d9c2_EOF
  243. cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md"
  244. cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md"
  245. cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md"
  246. cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md"
  247. cat << 'GH_AW_PROMPT_9e10a58f1e12d9c2_EOF'
  248. <safe-output-tools>
  249. Tools: add_comment, add_labels(max:2), call_workflow, missing_tool, missing_data, noop
  250. </safe-output-tools>
  251. GH_AW_PROMPT_9e10a58f1e12d9c2_EOF
  252. cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md"
  253. cat << 'GH_AW_PROMPT_9e10a58f1e12d9c2_EOF'
  254. <github-context>
  255. The following GitHub context information is available for this workflow:
  256. {{#if github.actor}}
  257. - **actor**: __GH_AW_GITHUB_ACTOR__
  258. {{/if}}
  259. {{#if github.repository}}
  260. - **repository**: __GH_AW_GITHUB_REPOSITORY__
  261. {{/if}}
  262. {{#if github.workspace}}
  263. - **workspace**: __GH_AW_GITHUB_WORKSPACE__
  264. {{/if}}
  265. {{#if github.event.issue.number || (github.aw.context.item_type == 'issue' && github.aw.context.item_number)}}
  266. - **issue-number**: #__GH_AW_EXPR_802A9F6A__
  267. {{/if}}
  268. {{#if github.event.discussion.number || (github.aw.context.item_type == 'discussion' && github.aw.context.item_number)}}
  269. - **discussion-number**: #__GH_AW_EXPR_1A3A194A__
  270. {{/if}}
  271. {{#if github.event.pull_request.number || (github.aw.context.item_type == 'pull_request' && github.aw.context.item_number)}}
  272. - **pull-request-number**: #__GH_AW_EXPR_463A214A__
  273. {{/if}}
  274. {{#if github.event.comment.id || github.aw.context.comment_id}}
  275. - **comment-id**: __GH_AW_EXPR_FF1D34CE__
  276. {{/if}}
  277. {{#if github.run_id}}
  278. - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__
  279. {{/if}}
  280. </github-context>
  281. GH_AW_PROMPT_9e10a58f1e12d9c2_EOF
  282. cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md"
  283. cat << 'GH_AW_PROMPT_9e10a58f1e12d9c2_EOF'
  284. </system>
  285. {{#runtime-import .github/workflows/shared/engine.md}}
  286. {{#runtime-import .github/workflows/shared/network.md}}
  287. {{#runtime-import .github/workflows/issue-triage.md}}
  288. GH_AW_PROMPT_9e10a58f1e12d9c2_EOF
  289. } > "$GH_AW_PROMPT"
  290. - name: Interpolate variables and render templates
  291. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  292. env:
  293. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  294. GH_AW_ENGINE_ID: "codex"
  295. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  296. GH_AW_EXPR_54492A5B: ${{ github.event.issue.number || inputs.issue_number }}
  297. GH_AW_GITHUB_EVENT_ISSUE_TITLE: ${{ github.event.issue.title }}
  298. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  299. GH_AW_INPUTS_ISSUE_NUMBER: ${{ inputs.issue_number }}
  300. with:
  301. script: |
  302. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  303. setupGlobals(core, github, context, exec, io, getOctokit);
  304. const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs');
  305. await main();
  306. - name: Substitute placeholders
  307. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  308. env:
  309. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  310. GH_AW_EXPR_1A3A194A: ${{ github.event.discussion.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'discussion' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }}
  311. GH_AW_EXPR_463A214A: ${{ github.event.pull_request.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'pull_request' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }}
  312. GH_AW_EXPR_54492A5B: ${{ github.event.issue.number || inputs.issue_number }}
  313. GH_AW_EXPR_802A9F6A: ${{ github.event.issue.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'issue' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }}
  314. GH_AW_EXPR_FF1D34CE: ${{ github.event.comment.id || fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').comment_id }}
  315. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  316. GH_AW_GITHUB_EVENT_ISSUE_TITLE: ${{ github.event.issue.title }}
  317. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  318. GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
  319. GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
  320. GH_AW_INPUTS_ISSUE_NUMBER: ${{ inputs.issue_number }}
  321. GH_AW_MCP_CLI_SERVERS_LIST: '- `safeoutputs` — run `safeoutputs --help` to see available tools'
  322. with:
  323. script: |
  324. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  325. setupGlobals(core, github, context, exec, io, getOctokit);
  326. const substitutePlaceholders = require('${{ runner.temp }}/gh-aw/actions/substitute_placeholders.cjs');
  327. // Call the substitution function
  328. return await substitutePlaceholders({
  329. file: process.env.GH_AW_PROMPT,
  330. substitutions: {
  331. GH_AW_EXPR_1A3A194A: process.env.GH_AW_EXPR_1A3A194A,
  332. GH_AW_EXPR_463A214A: process.env.GH_AW_EXPR_463A214A,
  333. GH_AW_EXPR_54492A5B: process.env.GH_AW_EXPR_54492A5B,
  334. GH_AW_EXPR_802A9F6A: process.env.GH_AW_EXPR_802A9F6A,
  335. GH_AW_EXPR_FF1D34CE: process.env.GH_AW_EXPR_FF1D34CE,
  336. GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR,
  337. GH_AW_GITHUB_EVENT_ISSUE_TITLE: process.env.GH_AW_GITHUB_EVENT_ISSUE_TITLE,
  338. GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY,
  339. GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID,
  340. GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE,
  341. GH_AW_INPUTS_ISSUE_NUMBER: process.env.GH_AW_INPUTS_ISSUE_NUMBER,
  342. GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST
  343. }
  344. });
  345. - name: Validate prompt placeholders
  346. env:
  347. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  348. # poutine:ignore untrusted_checkout_exec
  349. run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh"
  350. - name: Print prompt
  351. env:
  352. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  353. # poutine:ignore untrusted_checkout_exec
  354. run: bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh"
  355. - name: Upload activation artifact
  356. if: success()
  357. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  358. with:
  359. name: activation
  360. include-hidden-files: true
  361. path: |
  362. /tmp/gh-aw/aw_info.json
  363. /tmp/gh-aw/model_multipliers.json
  364. /tmp/gh-aw/models.json
  365. /tmp/gh-aw/aw-prompts/prompt.txt
  366. /tmp/gh-aw/aw-prompts/prompt-template.txt
  367. /tmp/gh-aw/aw-prompts/prompt-import-tree.json
  368. /tmp/gh-aw/github_rate_limits.jsonl
  369. /tmp/gh-aw/base
  370. /tmp/gh-aw/.codex/agents
  371. /tmp/gh-aw/.codex/skills
  372. if-no-files-found: ignore
  373. retention-days: 1
  374. agent:
  375. needs: activation
  376. if: needs.activation.outputs.daily_effective_workflow_exceeded != 'true'
  377. runs-on: ubuntu-latest
  378. permissions:
  379. actions: read
  380. checks: read
  381. contents: read
  382. discussions: read
  383. issues: read
  384. pull-requests: read
  385. statuses: read
  386. env:
  387. DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
  388. GH_AW_ASSETS_ALLOWED_EXTS: ""
  389. GH_AW_ASSETS_BRANCH: ""
  390. GH_AW_ASSETS_MAX_SIZE_KB: 0
  391. GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
  392. GH_AW_WORKFLOW_ID_SANITIZED: issuetriage
  393. outputs:
  394. agentic_engine_timeout: ${{ steps.detect-agent-errors.outputs.agentic_engine_timeout || 'false' }}
  395. ai_credits_rate_limit_error: ${{ steps.parse-mcp-gateway.outputs.ai_credits_rate_limit_error || 'false' }}
  396. aic: ${{ steps.parse-mcp-gateway.outputs.aic }}
  397. ambient_context: ${{ steps.parse-mcp-gateway.outputs.ambient_context }}
  398. checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }}
  399. effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }}
  400. has_patch: ${{ steps.collect_output.outputs.has_patch }}
  401. inference_access_error: ${{ steps.detect-agent-errors.outputs.inference_access_error || 'false' }}
  402. mcp_policy_error: ${{ steps.detect-agent-errors.outputs.mcp_policy_error || 'false' }}
  403. model: ${{ needs.activation.outputs.model }}
  404. model_not_supported_error: ${{ steps.detect-agent-errors.outputs.model_not_supported_error || 'false' }}
  405. output: ${{ steps.collect_output.outputs.output }}
  406. output_types: ${{ steps.collect_output.outputs.output_types }}
  407. setup-parent-span-id: ${{ steps.setup.outputs.parent-span-id || steps.setup.outputs.span-id }}
  408. setup-span-id: ${{ steps.setup.outputs.span-id }}
  409. setup-trace-id: ${{ steps.setup.outputs.trace-id }}
  410. steps:
  411. - name: Setup Scripts
  412. id: setup
  413. uses: github/gh-aw-actions/setup@7cfd95b59ca996b7e2bebd6222e21ddd187a4e91 # v0.79.4
  414. with:
  415. destination: ${{ runner.temp }}/gh-aw/actions
  416. job-name: ${{ github.job }}
  417. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  418. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  419. env:
  420. GH_AW_SETUP_WORKFLOW_NAME: "Issue Triage"
  421. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-triage.lock.yml@${{ github.ref }}
  422. GH_AW_INFO_VERSION: "0.137.0"
  423. GH_AW_INFO_AWF_VERSION: "v0.27.0"
  424. GH_AW_INFO_ENGINE_ID: "codex"
  425. - name: Set runtime paths
  426. id: set-runtime-paths
  427. run: |
  428. {
  429. echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl"
  430. echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json"
  431. echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json"
  432. } >> "$GITHUB_OUTPUT"
  433. - name: Checkout repository
  434. uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
  435. with:
  436. persist-credentials: false
  437. - name: Create gh-aw temp directory
  438. run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh"
  439. - name: Configure gh CLI for GitHub Enterprise
  440. run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh"
  441. env:
  442. GH_TOKEN: ${{ github.token }}
  443. - name: Configure Git credentials
  444. env:
  445. REPO_NAME: ${{ github.repository }}
  446. SERVER_URL: ${{ github.server_url }}
  447. GITHUB_TOKEN: ${{ github.token }}
  448. run: |
  449. git config --global user.email "github-actions[bot]@users.noreply.github.com"
  450. git config --global user.name "github-actions[bot]"
  451. git config --global am.keepcr true
  452. # Re-authenticate git with GitHub token
  453. SERVER_URL_STRIPPED="${SERVER_URL#https://}"
  454. git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
  455. echo "Git configured with standard GitHub Actions identity"
  456. - name: Checkout PR branch
  457. id: checkout-pr
  458. if: |
  459. github.event.pull_request || github.event.issue.pull_request || github.event_name == 'workflow_dispatch' && fromJSON(github.event.inputs.aw_context || '{}').item_type == 'pull_request'
  460. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  461. env:
  462. GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  463. with:
  464. github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  465. script: |
  466. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  467. setupGlobals(core, github, context, exec, io, getOctokit);
  468. const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs');
  469. await main();
  470. - name: Setup Node.js
  471. uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
  472. with:
  473. node-version: '24'
  474. package-manager-cache: false
  475. - name: Install Codex CLI
  476. run: npm install --ignore-scripts -g @openai/codex@0.137.0
  477. - name: Install AWF binary
  478. run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.0
  479. - name: Parse integrity filter lists
  480. id: parse-guard-vars
  481. env:
  482. GH_AW_BLOCKED_USERS_VAR: ${{ vars.GH_AW_GITHUB_BLOCKED_USERS || '' }}
  483. GH_AW_TRUSTED_USERS_VAR: ${{ vars.GH_AW_GITHUB_TRUSTED_USERS || '' }}
  484. GH_AW_APPROVAL_LABELS_VAR: ${{ vars.GH_AW_GITHUB_APPROVAL_LABELS || '' }}
  485. run: bash "${RUNNER_TEMP}/gh-aw/actions/parse_guard_list.sh"
  486. - name: Download activation artifact
  487. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  488. with:
  489. name: activation
  490. path: /tmp/gh-aw
  491. - name: Restore agent config folders from base branch
  492. if: steps.checkout-pr.outcome == 'success'
  493. env:
  494. GH_AW_AGENT_FOLDERS: ".agents .antigravity .claude .codex .crush .gemini .github .opencode .pi"
  495. GH_AW_AGENT_FILES: ".crush.json AGENTS.md ANTIGRAVITY.md CLAUDE.md GEMINI.md PI.md opencode.jsonc"
  496. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh"
  497. - name: Restore inline sub-agents from activation artifact
  498. env:
  499. GH_AW_SUB_AGENT_DIR: ".codex/agents"
  500. GH_AW_SUB_AGENT_EXT: ".md"
  501. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_sub_agents.sh"
  502. - name: Restore inline skills from activation artifact
  503. env:
  504. GH_AW_SKILL_DIR: ".codex/skills"
  505. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_skills.sh"
  506. - name: Download container images
  507. run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.0 ghcr.io/github/gh-aw-firewall/api-proxy:0.27.0 ghcr.io/github/gh-aw-firewall/squid:0.27.0 ghcr.io/github/gh-aw-mcpg:v0.3.25@sha256:c10331ad17668ef89f38f5e356678788a40b0cd5fef96e8f92e1d9c1de47cbaa ghcr.io/github/github-mcp-server:v1.1.2@sha256:30197479d8036c7811892bc07e06f9a05c9ef3cdd79bc59f256d50647f95788c node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14
  508. - name: Generate Safe Outputs Config
  509. run: |
  510. mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"
  511. mkdir -p /tmp/gh-aw/safeoutputs
  512. mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
  513. cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_7f05fa4491cc85b2_EOF'
  514. {"add_comment":{"max":1,"target":"triggering"},"add_labels":{"allowed":["bug","enhancement","question","other"],"max":2,"target":"triggering"},"call_workflow":{"max":1,"workflow_files":{"issue-handle-bug":"./.github/workflows/issue-handle-bug.lock.yml","issue-handle-enhancement":"./.github/workflows/issue-handle-enhancement.lock.yml","issue-handle-other":"./.github/workflows/issue-handle-other.lock.yml","issue-handle-question":"./.github/workflows/issue-handle-question.lock.yml"},"workflows":["issue-handle-bug","issue-handle-enhancement","issue-handle-question","issue-handle-other"]},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}}
  515. GH_AW_SAFE_OUTPUTS_CONFIG_7f05fa4491cc85b2_EOF
  516. - name: Generate Safe Outputs Tools
  517. env:
  518. GH_AW_TOOLS_META_JSON: |
  519. {
  520. "description_suffixes": {
  521. "add_comment": " CONSTRAINTS: Maximum 1 comment(s) can be added. Target: triggering. Supports reply_to_id for discussion threading.",
  522. "add_labels": " CONSTRAINTS: Maximum 2 label(s) can be added. Only these labels are allowed: [\"bug\" \"enhancement\" \"question\" \"other\"]. Target: triggering."
  523. },
  524. "repo_params": {},
  525. "dynamic_tools": [
  526. {
  527. "_call_workflow_name": "issue-handle-bug",
  528. "description": "Call the 'issue-handle-bug' reusable workflow via workflow_call. This workflow must support workflow_call and be in .github/workflows/ directory in the same repository.",
  529. "inputSchema": {
  530. "additionalProperties": false,
  531. "properties": {
  532. "aw_context": {
  533. "default": "",
  534. "description": "Agent caller context (used internally by Agentic Workflows).",
  535. "type": "string"
  536. },
  537. "issue_number": {
  538. "description": "Input parameter 'issue_number' for workflow issue-handle-bug",
  539. "type": "string"
  540. },
  541. "payload": {
  542. "description": "Input parameter 'payload' for workflow issue-handle-bug",
  543. "type": "string"
  544. }
  545. },
  546. "required": [
  547. "issue_number"
  548. ],
  549. "type": "object"
  550. },
  551. "name": "issue_handle_bug"
  552. },
  553. {
  554. "_call_workflow_name": "issue-handle-enhancement",
  555. "description": "Call the 'issue-handle-enhancement' reusable workflow via workflow_call. This workflow must support workflow_call and be in .github/workflows/ directory in the same repository.",
  556. "inputSchema": {
  557. "additionalProperties": false,
  558. "properties": {
  559. "aw_context": {
  560. "default": "",
  561. "description": "Agent caller context (used internally by Agentic Workflows).",
  562. "type": "string"
  563. },
  564. "issue_number": {
  565. "description": "Input parameter 'issue_number' for workflow issue-handle-enhancement",
  566. "type": "string"
  567. },
  568. "payload": {
  569. "description": "Input parameter 'payload' for workflow issue-handle-enhancement",
  570. "type": "string"
  571. }
  572. },
  573. "required": [
  574. "issue_number"
  575. ],
  576. "type": "object"
  577. },
  578. "name": "issue_handle_enhancement"
  579. },
  580. {
  581. "_call_workflow_name": "issue-handle-question",
  582. "description": "Call the 'issue-handle-question' reusable workflow via workflow_call. This workflow must support workflow_call and be in .github/workflows/ directory in the same repository.",
  583. "inputSchema": {
  584. "additionalProperties": false,
  585. "properties": {
  586. "aw_context": {
  587. "default": "",
  588. "description": "Agent caller context (used internally by Agentic Workflows).",
  589. "type": "string"
  590. },
  591. "issue_number": {
  592. "description": "Input parameter 'issue_number' for workflow issue-handle-question",
  593. "type": "string"
  594. },
  595. "payload": {
  596. "description": "Input parameter 'payload' for workflow issue-handle-question",
  597. "type": "string"
  598. }
  599. },
  600. "required": [
  601. "issue_number"
  602. ],
  603. "type": "object"
  604. },
  605. "name": "issue_handle_question"
  606. },
  607. {
  608. "_call_workflow_name": "issue-handle-other",
  609. "description": "Call the 'issue-handle-other' reusable workflow via workflow_call. This workflow must support workflow_call and be in .github/workflows/ directory in the same repository.",
  610. "inputSchema": {
  611. "additionalProperties": false,
  612. "properties": {
  613. "aw_context": {
  614. "default": "",
  615. "description": "Agent caller context (used internally by Agentic Workflows).",
  616. "type": "string"
  617. },
  618. "issue_number": {
  619. "description": "Input parameter 'issue_number' for workflow issue-handle-other",
  620. "type": "string"
  621. },
  622. "payload": {
  623. "description": "Input parameter 'payload' for workflow issue-handle-other",
  624. "type": "string"
  625. }
  626. },
  627. "required": [
  628. "issue_number"
  629. ],
  630. "type": "object"
  631. },
  632. "name": "issue_handle_other"
  633. }
  634. ]
  635. }
  636. GH_AW_VALIDATION_JSON: |
  637. {
  638. "add_comment": {
  639. "defaultMax": 1,
  640. "fields": {
  641. "body": {
  642. "required": true,
  643. "type": "string",
  644. "sanitize": true,
  645. "maxLength": 65000
  646. },
  647. "item_number": {
  648. "issueOrPRNumber": true
  649. },
  650. "reply_to_id": {
  651. "type": "string",
  652. "maxLength": 256
  653. },
  654. "repo": {
  655. "type": "string",
  656. "maxLength": 256
  657. }
  658. }
  659. },
  660. "add_labels": {
  661. "defaultMax": 5,
  662. "fields": {
  663. "item_number": {
  664. "issueNumberOrTemporaryId": true
  665. },
  666. "labels": {
  667. "required": true,
  668. "type": "array",
  669. "itemType": "string",
  670. "itemSanitize": true,
  671. "itemMaxLength": 128
  672. },
  673. "repo": {
  674. "type": "string",
  675. "maxLength": 256
  676. }
  677. }
  678. },
  679. "missing_data": {
  680. "defaultMax": 20,
  681. "fields": {
  682. "alternatives": {
  683. "type": "string",
  684. "sanitize": true,
  685. "maxLength": 256
  686. },
  687. "context": {
  688. "type": "string",
  689. "sanitize": true,
  690. "maxLength": 256
  691. },
  692. "data_type": {
  693. "type": "string",
  694. "sanitize": true,
  695. "maxLength": 128
  696. },
  697. "reason": {
  698. "type": "string",
  699. "sanitize": true,
  700. "maxLength": 256
  701. }
  702. }
  703. },
  704. "missing_tool": {
  705. "defaultMax": 20,
  706. "fields": {
  707. "alternatives": {
  708. "type": "string",
  709. "sanitize": true,
  710. "maxLength": 512
  711. },
  712. "reason": {
  713. "required": true,
  714. "type": "string",
  715. "sanitize": true,
  716. "maxLength": 256
  717. },
  718. "tool": {
  719. "type": "string",
  720. "sanitize": true,
  721. "maxLength": 128
  722. }
  723. }
  724. },
  725. "noop": {
  726. "defaultMax": 1,
  727. "fields": {
  728. "message": {
  729. "required": true,
  730. "type": "string",
  731. "sanitize": true,
  732. "maxLength": 65000
  733. }
  734. }
  735. },
  736. "report_incomplete": {
  737. "defaultMax": 5,
  738. "fields": {
  739. "details": {
  740. "type": "string",
  741. "sanitize": true,
  742. "maxLength": 65000
  743. },
  744. "reason": {
  745. "required": true,
  746. "type": "string",
  747. "sanitize": true,
  748. "maxLength": 1024
  749. }
  750. }
  751. }
  752. }
  753. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  754. with:
  755. script: |
  756. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  757. setupGlobals(core, github, context, exec, io, getOctokit);
  758. const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_safe_outputs_tools.cjs');
  759. await main();
  760. - name: Generate Safe Outputs MCP Server Config
  761. id: safe-outputs-config
  762. run: |
  763. # Generate a secure random API key (360 bits of entropy, 40+ chars)
  764. # Mask immediately to prevent timing vulnerabilities
  765. API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
  766. echo "::add-mask::${API_KEY}"
  767. PORT=3001
  768. # Set outputs for next steps
  769. {
  770. echo "safe_outputs_api_key=${API_KEY}"
  771. echo "safe_outputs_port=${PORT}"
  772. } >> "$GITHUB_OUTPUT"
  773. echo "Safe Outputs MCP server will run on port ${PORT}"
  774. - name: Start Safe Outputs MCP HTTP Server
  775. id: safe-outputs-start
  776. env:
  777. DEBUG: '*'
  778. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  779. GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }}
  780. GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }}
  781. GH_AW_SAFE_OUTPUTS_TOOLS_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/tools.json
  782. GH_AW_SAFE_OUTPUTS_CONFIG_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/config.json
  783. GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
  784. run: |
  785. # Environment variables are set above to prevent template injection
  786. export DEBUG
  787. export GH_AW_SAFE_OUTPUTS
  788. export GH_AW_SAFE_OUTPUTS_PORT
  789. export GH_AW_SAFE_OUTPUTS_API_KEY
  790. export GH_AW_SAFE_OUTPUTS_TOOLS_PATH
  791. export GH_AW_SAFE_OUTPUTS_CONFIG_PATH
  792. export GH_AW_MCP_LOG_DIR
  793. bash "${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh"
  794. - name: Start MCP Gateway
  795. id: start-mcp-gateway
  796. env:
  797. CODEX_HOME: /tmp/gh-aw/mcp-config
  798. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  799. GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }}
  800. GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }}
  801. GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  802. run: |
  803. set -eo pipefail
  804. mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config"
  805. # Export gateway environment variables for MCP config and gateway script
  806. export MCP_GATEWAY_PORT="8080"
  807. export MCP_GATEWAY_DOMAIN="host.docker.internal"
  808. export MCP_GATEWAY_HOST_DOMAIN="localhost"
  809. MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
  810. echo "::add-mask::${MCP_GATEWAY_API_KEY}"
  811. export MCP_GATEWAY_API_KEY
  812. export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
  813. mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
  814. export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
  815. export DEBUG="*"
  816. export GH_AW_ENGINE="codex"
  817. MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')
  818. MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')
  819. case "${DOCKER_HOST:-}" in
  820. unix://* ) DOCKER_SOCK_PATH="${DOCKER_HOST#unix://}" ;;
  821. /* ) DOCKER_SOCK_PATH="$DOCKER_HOST" ;;
  822. * ) DOCKER_SOCK_PATH=/var/run/docker.sock ;;
  823. esac
  824. DOCKER_SOCK_GID=$(stat -c '%g' "$DOCKER_SOCK_PATH" 2>/dev/null || echo '0')
  825. export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --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_API_KEY -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_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 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 GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -e CODEX_HOME -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 ghcr.io/github/gh-aw-mcpg:v0.3.25'
  826. cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_52f10deab68ccf89_EOF
  827. [history]
  828. persistence = "none"
  829. [shell_environment_policy]
  830. inherit = "core"
  831. include_only = ["^CODEX_API_KEY$", "^GH_AW_ASSETS_ALLOWED_EXTS$", "^GH_AW_ASSETS_BRANCH$", "^GH_AW_ASSETS_MAX_SIZE_KB$", "^GH_AW_SAFE_OUTPUTS$", "^GITHUB_PERSONAL_ACCESS_TOKEN$", "^GITHUB_REPOSITORY$", "^GITHUB_SERVER_URL$", "^HOME$", "^OPENAI_API_KEY$", "^PATH$"]
  832. [mcp_servers.github]
  833. user_agent = "issue-triage"
  834. startup_timeout_sec = 120
  835. tool_timeout_sec = 60
  836. container = "ghcr.io/github/github-mcp-server:v1.1.2"
  837. env = { "GITHUB_HOST" = "$GITHUB_SERVER_URL", "GITHUB_PERSONAL_ACCESS_TOKEN" = "$GH_AW_GITHUB_TOKEN", "GITHUB_READ_ONLY" = "1", "GITHUB_TOOLSETS" = "context,repos,issues,pull_requests" }
  838. env_vars = ["GITHUB_HOST", "GITHUB_PERSONAL_ACCESS_TOKEN", "GITHUB_READ_ONLY", "GITHUB_TOOLSETS"]
  839. [mcp_servers.safeoutputs]
  840. type = "http"
  841. url = "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT"
  842. [mcp_servers.safeoutputs.headers]
  843. Authorization = "$GH_AW_SAFE_OUTPUTS_API_KEY"
  844. [mcp_servers.safeoutputs."guard-policies"]
  845. [mcp_servers.safeoutputs."guard-policies".write-sink]
  846. accept = ["*"]
  847. GH_AW_MCP_CONFIG_52f10deab68ccf89_EOF
  848. # Generate JSON config for MCP gateway
  849. GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
  850. cat << GH_AW_MCP_CONFIG_ca772287f17ffc28_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
  851. {
  852. "mcpServers": {
  853. "github": {
  854. "container": "ghcr.io/github/github-mcp-server:v1.1.2",
  855. "env": {
  856. "GITHUB_HOST": "$GITHUB_SERVER_URL",
  857. "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_MCP_SERVER_TOKEN",
  858. "GITHUB_READ_ONLY": "1",
  859. "GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
  860. },
  861. "guard-policies": {
  862. "allow-only": {
  863. "approval-labels": ${{ steps.parse-guard-vars.outputs.approval_labels }},
  864. "blocked-users": ${{ steps.parse-guard-vars.outputs.blocked_users }},
  865. "min-integrity": "none",
  866. "repos": "all",
  867. "trusted-users": ${{ steps.parse-guard-vars.outputs.trusted_users }}
  868. }
  869. }
  870. },
  871. "safeoutputs": {
  872. "type": "http",
  873. "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT",
  874. "headers": {
  875. "Authorization": "$GH_AW_SAFE_OUTPUTS_API_KEY"
  876. },
  877. "guard-policies": {
  878. "write-sink": {
  879. "accept": [
  880. "*"
  881. ]
  882. }
  883. }
  884. }
  885. },
  886. "gateway": {
  887. "port": $MCP_GATEWAY_PORT,
  888. "domain": "${MCP_GATEWAY_DOMAIN}",
  889. "apiKey": "${MCP_GATEWAY_API_KEY}",
  890. "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
  891. }
  892. }
  893. GH_AW_MCP_CONFIG_ca772287f17ffc28_EOF
  894. # Sync converter output to writable CODEX_HOME for Codex
  895. mkdir -p /tmp/gh-aw/mcp-config
  896. cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_929fca99db4cd5ec_EOF
  897. model_provider = "openai-proxy"
  898. [model_providers.openai-proxy]
  899. name = "OpenAI AWF proxy"
  900. base_url = "http://172.30.0.30:10000"
  901. env_key = "OPENAI_API_KEY"
  902. supports_websockets = false
  903. [shell_environment_policy]
  904. inherit = "core"
  905. include_only = ["^CODEX_API_KEY$", "^GH_AW_ASSETS_ALLOWED_EXTS$", "^GH_AW_ASSETS_BRANCH$", "^GH_AW_ASSETS_MAX_SIZE_KB$", "^GH_AW_SAFE_OUTPUTS$", "^GITHUB_PERSONAL_ACCESS_TOKEN$", "^GITHUB_REPOSITORY$", "^GITHUB_SERVER_URL$", "^HOME$", "^OPENAI_API_KEY$", "^PATH$"]
  906. GH_AW_CODEX_SHELL_POLICY_929fca99db4cd5ec_EOF
  907. awk '
  908. BEGIN { skip_openai_proxy = 0 }
  909. /^[[:space:]]*model_provider[[:space:]]*=/ { next }
  910. /^\[model_providers\.openai-proxy\][[:space:]]*$/ { skip_openai_proxy = 1; next }
  911. /^\[/ { skip_openai_proxy = 0 }
  912. !skip_openai_proxy { print }
  913. ' "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" >> "/tmp/gh-aw/mcp-config/config.toml"
  914. chmod 600 "/tmp/gh-aw/mcp-config/config.toml"
  915. mkdir -p "${CODEX_HOME}"
  916. if [ "/tmp/gh-aw/mcp-config/config.toml" != "${CODEX_HOME}/config.toml" ]; then cp "/tmp/gh-aw/mcp-config/config.toml" "${CODEX_HOME}/config.toml"; fi
  917. chmod 600 "${CODEX_HOME}/config.toml"
  918. - name: Mount MCP servers as CLIs
  919. id: mount-mcp-clis
  920. continue-on-error: true
  921. env:
  922. MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
  923. MCP_GATEWAY_DOMAIN: ${{ steps.start-mcp-gateway.outputs.gateway-domain }}
  924. MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
  925. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  926. with:
  927. script: |
  928. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  929. setupGlobals(core, github, context, exec, io);
  930. const { main } = require('${{ runner.temp }}/gh-aw/actions/mount_mcp_as_cli.cjs');
  931. await main();
  932. - name: Clean credentials
  933. continue-on-error: true
  934. run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh"
  935. - name: Audit pre-agent workspace
  936. id: pre_agent_audit
  937. continue-on-error: true
  938. run: bash "${RUNNER_TEMP}/gh-aw/actions/audit_pre_agent_workspace.sh"
  939. - name: Execute Codex CLI
  940. id: agentic_execution
  941. run: |
  942. set -o pipefail
  943. printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
  944. mkdir -p "$CODEX_HOME/logs" && touch /tmp/gh-aw/agent-step-summary.md
  945. (umask 177 && touch /tmp/gh-aw/agent-stdio.log)
  946. GH_AW_MAX_AI_CREDITS="${{ vars.GH_AW_DEFAULT_MAX_AI_CREDITS || '1000' }}"
  947. printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.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.minimaxi.com\",\"api.openai.com\",\"api.snapcraft.io\",\"archive.ubuntu.com\",\"azure.archive.ubuntu.com\",\"chatgpt.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\",\"host.docker.internal\",\"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\",\"openai.com\",\"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\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"targets\":{\"openai\":{\"host\":\"ai-pixel.online\"}},\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\"],\"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*\"],\"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-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-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.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*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"large\":[\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"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\"],\"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-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"vision\":[\"copilot/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.0\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
  948. GH_AW_MODEL_MULTIPLIERS_PATH="/tmp/gh-aw/model_multipliers.json" node "${RUNNER_TEMP}/gh-aw/actions/merge_awf_model_multipliers.cjs"
  949. cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
  950. export GH_AW_MODELS_JSON_PATH="/tmp/gh-aw/models.json"
  951. GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS=""
  952. if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then
  953. GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS="--docker-host-path-prefix /tmp/gh-aw"
  954. fi
  955. GH_AW_TOOL_CACHE_MOUNT=""
  956. GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"
  957. if [ -d "$GH_AW_TOOL_CACHE" ]; then
  958. if [[ "$GH_AW_TOOL_CACHE" != /opt/* ]]; then
  959. GH_AW_TOOL_CACHE_MOUNT="$GH_AW_TOOL_CACHE:$GH_AW_TOOL_CACHE:ro"
  960. fi
  961. elif [ -d "/home/runner/work/_tool" ]; then
  962. GH_AW_TOOL_CACHE_MOUNT="/home/runner/work/_tool:/home/runner/work/_tool:ro"
  963. fi
  964. # shellcheck disable=SC1003
  965. sudo -E 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_PATH_PREFIX_ARGS} --env-all --exclude-env CODEX_API_KEY --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --exclude-env OPENAI_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \
  966. -- /bin/bash -c 'set +o histexpand; export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"; export PATH="$(find "$GH_AW_TOOL_CACHE" /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/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" -c fetch="disabled" --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
  967. env:
  968. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
  969. CODEX_HOME: /tmp/gh-aw/mcp-config
  970. GH_AW_MAX_TURNS: ${{ vars.GH_AW_DEFAULT_MAX_TURNS || '' }}
  971. GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/config.toml
  972. GH_AW_MODEL_AGENT_CODEX: gpt-5.4
  973. GH_AW_PHASE: agent
  974. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  975. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  976. GH_AW_VERSION: v0.79.4
  977. GITHUB_AW: true
  978. GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
  979. GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
  980. GIT_AUTHOR_NAME: github-actions[bot]
  981. GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
  982. GIT_COMMITTER_NAME: github-actions[bot]
  983. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  984. OPENAI_BASE_URL: https://ai-pixel.online
  985. RUNNER_TEMP: ${{ runner.temp }}
  986. RUST_LOG: ${{ runner.debug == 1 && 'trace,hyper_util=info,mio=info,reqwest=info,os_info=info,codex_otel=warn,codex_core=debug,ocodex_exec=debug' || 'warn' }}
  987. - name: Detect agent errors
  988. if: always()
  989. id: detect-agent-errors
  990. continue-on-error: true
  991. run: node "${RUNNER_TEMP}/gh-aw/actions/detect_agent_errors.cjs"
  992. - name: Configure Git credentials
  993. env:
  994. REPO_NAME: ${{ github.repository }}
  995. SERVER_URL: ${{ github.server_url }}
  996. GITHUB_TOKEN: ${{ github.token }}
  997. run: |
  998. git config --global user.email "github-actions[bot]@users.noreply.github.com"
  999. git config --global user.name "github-actions[bot]"
  1000. git config --global am.keepcr true
  1001. # Re-authenticate git with GitHub token
  1002. SERVER_URL_STRIPPED="${SERVER_URL#https://}"
  1003. git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
  1004. echo "Git configured with standard GitHub Actions identity"
  1005. - name: Stop MCP Gateway
  1006. if: always()
  1007. continue-on-error: true
  1008. env:
  1009. MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
  1010. MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
  1011. GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }}
  1012. run: |
  1013. bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID"
  1014. - name: Redact secrets in logs
  1015. if: always()
  1016. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1017. with:
  1018. script: |
  1019. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1020. setupGlobals(core, github, context, exec, io, getOctokit);
  1021. const { main } = require('${{ runner.temp }}/gh-aw/actions/redact_secrets.cjs');
  1022. await main();
  1023. env:
  1024. 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'
  1025. SECRET_CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  1026. SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  1027. SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  1028. SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1029. SECRET_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  1030. SECRET_PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1031. - name: Append agent step summary
  1032. if: always()
  1033. run: bash "${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh"
  1034. - name: Copy Safe Outputs
  1035. if: always()
  1036. env:
  1037. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  1038. run: |
  1039. mkdir -p /tmp/gh-aw
  1040. cp "$GH_AW_SAFE_OUTPUTS" /tmp/gh-aw/safeoutputs.jsonl 2>/dev/null || true
  1041. - name: Ingest agent output
  1042. id: collect_output
  1043. if: always()
  1044. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1045. env:
  1046. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  1047. GH_AW_ALLOWED_DOMAINS: "172.30.0.1,ai-pixel.online,api-inference.modelscope.cn,api.commandcode.ai,api.deepseek.com,api.minimaxi.com,api.openai.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,chatgpt.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,host.docker.internal,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,openai.com,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"
  1048. GITHUB_SERVER_URL: ${{ github.server_url }}
  1049. GITHUB_API_URL: ${{ github.api_url }}
  1050. with:
  1051. script: |
  1052. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1053. setupGlobals(core, github, context, exec, io, getOctokit);
  1054. const { main } = require('${{ runner.temp }}/gh-aw/actions/collect_ndjson_output.cjs');
  1055. await main();
  1056. - name: Parse agent logs for step summary
  1057. if: always()
  1058. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1059. env:
  1060. GH_AW_AGENT_OUTPUT: /tmp/gh-aw/agent-stdio.log
  1061. with:
  1062. script: |
  1063. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1064. setupGlobals(core, github, context, exec, io, getOctokit);
  1065. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_codex_log.cjs');
  1066. await main();
  1067. - name: Parse MCP Gateway logs for step summary
  1068. if: always()
  1069. id: parse-mcp-gateway
  1070. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1071. with:
  1072. script: |
  1073. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1074. setupGlobals(core, github, context, exec, io, getOctokit);
  1075. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_mcp_gateway_log.cjs');
  1076. await main();
  1077. - name: Print firewall logs
  1078. if: always()
  1079. continue-on-error: true
  1080. env:
  1081. AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
  1082. run: |
  1083. # Fix permissions on firewall logs/audit dirs so they can be uploaded as artifacts
  1084. # AWF runs with sudo, creating files owned by root
  1085. sudo chmod -R a+rX /tmp/gh-aw/sandbox/firewall 2>/dev/null || true
  1086. # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step)
  1087. if command -v awf &> /dev/null; then
  1088. awf logs summary | tee -a "$GITHUB_STEP_SUMMARY"
  1089. else
  1090. echo 'AWF binary not installed, skipping firewall log summary'
  1091. fi
  1092. - name: Parse token usage for step summary
  1093. if: always()
  1094. continue-on-error: true
  1095. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1096. with:
  1097. script: |
  1098. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1099. setupGlobals(core, github, context, exec, io, getOctokit);
  1100. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs');
  1101. await main();
  1102. - name: Print AWF reflect summary
  1103. if: always()
  1104. continue-on-error: true
  1105. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1106. with:
  1107. script: |
  1108. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1109. setupGlobals(core, github, context, exec, io, getOctokit);
  1110. const { main } = require('${{ runner.temp }}/gh-aw/actions/awf_reflect_summary.cjs');
  1111. await main();
  1112. - name: Write agent output placeholder if missing
  1113. if: always()
  1114. run: |
  1115. if [ ! -f /tmp/gh-aw/agent_output.json ]; then
  1116. echo '{"items":[]}' > /tmp/gh-aw/agent_output.json
  1117. fi
  1118. - name: Upload agent artifacts
  1119. if: always()
  1120. continue-on-error: true
  1121. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  1122. with:
  1123. name: agent
  1124. path: |
  1125. /tmp/gh-aw/aw-prompts/prompt.txt
  1126. /tmp/gh-aw/mcp-config/logs/
  1127. /tmp/gh-aw/redacted-urls.log
  1128. /tmp/gh-aw/mcp-logs/
  1129. /tmp/gh-aw/proxy-logs/
  1130. !/tmp/gh-aw/proxy-logs/proxy-tls/
  1131. /tmp/gh-aw/agent_usage.json
  1132. /tmp/gh-aw/agent-stdio.log
  1133. /tmp/gh-aw/pre-agent-audit.txt
  1134. /tmp/gh-aw/agent/
  1135. /tmp/gh-aw/github_rate_limits.jsonl
  1136. /tmp/gh-aw/safeoutputs.jsonl
  1137. /tmp/gh-aw/agent_output.json
  1138. /tmp/gh-aw/aw-*.patch
  1139. /tmp/gh-aw/aw-*.bundle
  1140. /tmp/gh-aw/awf-config.json
  1141. /tmp/gh-aw/sandbox/firewall/logs/
  1142. /tmp/gh-aw/sandbox/firewall/audit/
  1143. /tmp/gh-aw/sandbox/firewall/awf-reflect.json
  1144. if-no-files-found: ignore
  1145. call-issue-handle-bug:
  1146. needs: safe_outputs
  1147. if: needs.safe_outputs.outputs.call_workflow_name == 'issue-handle-bug'
  1148. permissions:
  1149. actions: read
  1150. checks: read
  1151. contents: read
  1152. discussions: write
  1153. issues: write
  1154. pull-requests: write
  1155. statuses: read
  1156. uses: ./.github/workflows/issue-handle-bug.lock.yml
  1157. with:
  1158. aw_context: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).aw_context }}
  1159. issue_number: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).issue_number }}
  1160. payload: ${{ needs.safe_outputs.outputs.call_workflow_payload }}
  1161. secrets:
  1162. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  1163. GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  1164. GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  1165. OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  1166. PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1167. call-issue-handle-enhancement:
  1168. needs: safe_outputs
  1169. if: needs.safe_outputs.outputs.call_workflow_name == 'issue-handle-enhancement'
  1170. permissions:
  1171. actions: read
  1172. checks: read
  1173. contents: read
  1174. discussions: write
  1175. issues: write
  1176. pull-requests: write
  1177. statuses: read
  1178. uses: ./.github/workflows/issue-handle-enhancement.lock.yml
  1179. with:
  1180. aw_context: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).aw_context }}
  1181. issue_number: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).issue_number }}
  1182. payload: ${{ needs.safe_outputs.outputs.call_workflow_payload }}
  1183. secrets:
  1184. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  1185. GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  1186. GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  1187. OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  1188. PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1189. call-issue-handle-other:
  1190. needs: safe_outputs
  1191. if: needs.safe_outputs.outputs.call_workflow_name == 'issue-handle-other'
  1192. permissions:
  1193. actions: read
  1194. checks: read
  1195. contents: read
  1196. discussions: write
  1197. issues: write
  1198. pull-requests: write
  1199. statuses: read
  1200. uses: ./.github/workflows/issue-handle-other.lock.yml
  1201. with:
  1202. aw_context: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).aw_context }}
  1203. issue_number: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).issue_number }}
  1204. payload: ${{ needs.safe_outputs.outputs.call_workflow_payload }}
  1205. secrets:
  1206. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  1207. GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  1208. GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  1209. OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  1210. PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1211. call-issue-handle-question:
  1212. needs: safe_outputs
  1213. if: needs.safe_outputs.outputs.call_workflow_name == 'issue-handle-question'
  1214. permissions:
  1215. actions: read
  1216. checks: read
  1217. contents: read
  1218. discussions: write
  1219. issues: write
  1220. pull-requests: write
  1221. statuses: read
  1222. uses: ./.github/workflows/issue-handle-question.lock.yml
  1223. with:
  1224. aw_context: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).aw_context }}
  1225. issue_number: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).issue_number }}
  1226. payload: ${{ needs.safe_outputs.outputs.call_workflow_payload }}
  1227. secrets:
  1228. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  1229. GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  1230. GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  1231. OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  1232. PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1233. conclusion:
  1234. needs:
  1235. - activation
  1236. - agent
  1237. - call-issue-handle-bug
  1238. - call-issue-handle-enhancement
  1239. - call-issue-handle-other
  1240. - call-issue-handle-question
  1241. - detection
  1242. - safe_outputs
  1243. if: >
  1244. always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' ||
  1245. needs.activation.outputs.stale_lock_file_failed == 'true' || needs.activation.outputs.daily_effective_workflow_exceeded == 'true')
  1246. runs-on: ubuntu-slim
  1247. permissions:
  1248. contents: read
  1249. discussions: write
  1250. issues: write
  1251. pull-requests: write
  1252. concurrency:
  1253. group: "gh-aw-conclusion-issue-triage"
  1254. cancel-in-progress: false
  1255. queue: max
  1256. outputs:
  1257. incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }}
  1258. noop_message: ${{ steps.noop.outputs.noop_message }}
  1259. tools_reported: ${{ steps.missing_tool.outputs.tools_reported }}
  1260. total_count: ${{ steps.missing_tool.outputs.total_count }}
  1261. steps:
  1262. - name: Setup Scripts
  1263. id: setup
  1264. uses: github/gh-aw-actions/setup@7cfd95b59ca996b7e2bebd6222e21ddd187a4e91 # v0.79.4
  1265. with:
  1266. destination: ${{ runner.temp }}/gh-aw/actions
  1267. job-name: ${{ github.job }}
  1268. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1269. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  1270. env:
  1271. GH_AW_SETUP_WORKFLOW_NAME: "Issue Triage"
  1272. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-triage.lock.yml@${{ github.ref }}
  1273. GH_AW_INFO_VERSION: "0.137.0"
  1274. GH_AW_INFO_AWF_VERSION: "v0.27.0"
  1275. GH_AW_INFO_ENGINE_ID: "codex"
  1276. - name: Download agent output artifact
  1277. id: download-agent-output
  1278. continue-on-error: true
  1279. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  1280. with:
  1281. name: agent
  1282. path: /tmp/gh-aw/
  1283. - name: Setup agent output environment variable
  1284. id: setup-agent-output-env
  1285. if: steps.download-agent-output.outcome == 'success'
  1286. run: |
  1287. mkdir -p /tmp/gh-aw/
  1288. find "/tmp/gh-aw/" -type f -print
  1289. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1290. - name: Collect usage artifact files
  1291. if: always()
  1292. continue-on-error: true
  1293. run: |
  1294. mkdir -p /tmp/gh-aw/usage/agent /tmp/gh-aw/usage/detection
  1295. echo "Usage artifact source file status:"
  1296. for file in /tmp/gh-aw/aw-info.jsonl /tmp/gh-aw/agent_usage.jsonl /tmp/gh-aw/detection_usage.jsonl /tmp/gh-aw/sandbox/firewall-audit-logs/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/sandbox/firewall/audit/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/threat-detection/sandbox/firewall-audit-logs/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/threat-detection/sandbox/firewall/logs/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/threat-detection/sandbox/firewall/audit/api-proxy-logs/token-usage.jsonl; do
  1297. [ -f "$file" ] && echo "FOUND: $file" || echo "MISSING: $file"
  1298. done
  1299. [ -f /tmp/gh-aw/aw-info.jsonl ] && cp /tmp/gh-aw/aw-info.jsonl /tmp/gh-aw/usage/aw-info.jsonl || true
  1300. [ -f /tmp/gh-aw/agent_usage.jsonl ] && cp /tmp/gh-aw/agent_usage.jsonl /tmp/gh-aw/usage/agent_usage.jsonl || true
  1301. [ -f /tmp/gh-aw/detection_usage.jsonl ] && cp /tmp/gh-aw/detection_usage.jsonl /tmp/gh-aw/usage/detection_usage.jsonl || true
  1302. [ -f /tmp/gh-aw/sandbox/firewall-audit-logs/api-proxy-logs/token-usage.jsonl ] && cp /tmp/gh-aw/sandbox/firewall-audit-logs/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/usage/agent/token_usage.jsonl || true
  1303. [ -f /tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs/token-usage.jsonl ] && cp /tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/usage/agent/token_usage.jsonl || true
  1304. [ -f /tmp/gh-aw/sandbox/firewall/audit/api-proxy-logs/token-usage.jsonl ] && cp /tmp/gh-aw/sandbox/firewall/audit/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/usage/agent/token_usage.jsonl || true
  1305. [ -f /tmp/gh-aw/threat-detection/sandbox/firewall-audit-logs/api-proxy-logs/token-usage.jsonl ] && cp /tmp/gh-aw/threat-detection/sandbox/firewall-audit-logs/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/usage/detection/token_usage.jsonl || true
  1306. [ -f /tmp/gh-aw/threat-detection/sandbox/firewall/logs/api-proxy-logs/token-usage.jsonl ] && cp /tmp/gh-aw/threat-detection/sandbox/firewall/logs/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/usage/detection/token_usage.jsonl || true
  1307. [ -f /tmp/gh-aw/threat-detection/sandbox/firewall/audit/api-proxy-logs/token-usage.jsonl ] && cp /tmp/gh-aw/threat-detection/sandbox/firewall/audit/api-proxy-logs/token-usage.jsonl /tmp/gh-aw/usage/detection/token_usage.jsonl || true
  1308. [ -f /tmp/gh-aw/usage/agent/token_usage.jsonl ] || : > /tmp/gh-aw/usage/agent/token_usage.jsonl
  1309. [ -f /tmp/gh-aw/usage/detection/token_usage.jsonl ] || : > /tmp/gh-aw/usage/detection/token_usage.jsonl
  1310. find /tmp/gh-aw/usage -type f -print | sort
  1311. - name: Upload usage artifact
  1312. if: always()
  1313. continue-on-error: true
  1314. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  1315. with:
  1316. name: usage
  1317. path: |
  1318. /tmp/gh-aw/usage/aw-info.jsonl
  1319. /tmp/gh-aw/usage/agent_usage.jsonl
  1320. /tmp/gh-aw/usage/detection_usage.jsonl
  1321. /tmp/gh-aw/usage/agent/token_usage.jsonl
  1322. /tmp/gh-aw/usage/detection/token_usage.jsonl
  1323. if-no-files-found: ignore
  1324. - name: Process no-op messages
  1325. id: noop
  1326. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1327. env:
  1328. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1329. GH_AW_NOOP_MAX: "1"
  1330. GH_AW_WORKFLOW_NAME: "Issue Triage"
  1331. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-triage.md"
  1332. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1333. GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
  1334. GH_AW_NOOP_REPORT_AS_ISSUE: "true"
  1335. GH_AW_AIC: ${{ needs.agent.outputs.aic }}
  1336. GH_AW_THREAT_DETECTION_AIC: ${{ needs.detection.outputs.aic }}
  1337. GH_AW_AMBIENT_CONTEXT: ${{ needs.agent.outputs.ambient_context }}
  1338. GH_AW_WORKFLOW_ID: "issue-triage"
  1339. with:
  1340. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1341. script: |
  1342. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1343. setupGlobals(core, github, context, exec, io, getOctokit);
  1344. const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs');
  1345. await main();
  1346. - name: Log detection run
  1347. id: detection_runs
  1348. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1349. env:
  1350. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1351. GH_AW_WORKFLOW_NAME: "Issue Triage"
  1352. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-triage.md"
  1353. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1354. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  1355. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  1356. with:
  1357. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1358. script: |
  1359. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1360. setupGlobals(core, github, context, exec, io, getOctokit);
  1361. const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_detection_runs.cjs');
  1362. await main();
  1363. - name: Record missing tool
  1364. id: missing_tool
  1365. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1366. env:
  1367. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1368. GH_AW_MISSING_TOOL_CREATE_ISSUE: "true"
  1369. GH_AW_WORKFLOW_NAME: "Issue Triage"
  1370. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-triage.md"
  1371. with:
  1372. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1373. script: |
  1374. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1375. setupGlobals(core, github, context, exec, io, getOctokit);
  1376. const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs');
  1377. await main();
  1378. - name: Record incomplete
  1379. id: report_incomplete
  1380. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1381. env:
  1382. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1383. GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true"
  1384. GH_AW_WORKFLOW_NAME: "Issue Triage"
  1385. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-triage.md"
  1386. with:
  1387. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1388. script: |
  1389. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1390. setupGlobals(core, github, context, exec, io, getOctokit);
  1391. const { main } = require('${{ runner.temp }}/gh-aw/actions/report_incomplete_handler.cjs');
  1392. await main();
  1393. - name: Handle agent failure
  1394. id: handle_agent_failure
  1395. if: always()
  1396. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1397. env:
  1398. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1399. GH_AW_WORKFLOW_NAME: "Issue Triage"
  1400. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-triage.md"
  1401. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1402. GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
  1403. GH_AW_WORKFLOW_ID: "issue-triage"
  1404. GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168"
  1405. GH_AW_ENGINE_ID: "codex"
  1406. GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
  1407. GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
  1408. GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens || '' }}
  1409. GH_AW_AI_CREDITS_RATE_LIMIT_ERROR: ${{ needs.agent.outputs.ai_credits_rate_limit_error || 'false' }}
  1410. GH_AW_AIC: ${{ needs.agent.outputs.aic }}
  1411. GH_AW_MAX_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_MAX_AI_CREDITS || '1000' }}
  1412. GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }}
  1413. GH_AW_MCP_POLICY_ERROR: ${{ needs.agent.outputs.mcp_policy_error }}
  1414. GH_AW_AGENTIC_ENGINE_TIMEOUT: ${{ needs.agent.outputs.agentic_engine_timeout }}
  1415. GH_AW_MODEL_NOT_SUPPORTED_ERROR: ${{ needs.agent.outputs.model_not_supported_error }}
  1416. GH_AW_ENGINE_API_HOSTS: "api.openai.com"
  1417. GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }}
  1418. GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }}
  1419. GH_AW_DAILY_EFFECTIVE_WORKFLOW_EXCEEDED: ${{ needs.activation.outputs.daily_effective_workflow_exceeded }}
  1420. GH_AW_DAILY_EFFECTIVE_WORKFLOW_TOTAL_EFFECTIVE_TOKENS: ${{ needs.activation.outputs.daily_effective_workflow_total_effective_tokens }}
  1421. GH_AW_DAILY_EFFECTIVE_WORKFLOW_THRESHOLD: ${{ needs.activation.outputs.daily_effective_workflow_threshold }}
  1422. GH_AW_GROUP_REPORTS: "false"
  1423. GH_AW_FAILURE_REPORT_AS_ISSUE: "true"
  1424. GH_AW_MISSING_TOOL_REPORT_AS_FAILURE: "true"
  1425. GH_AW_MISSING_DATA_REPORT_AS_FAILURE: "true"
  1426. GH_AW_TIMEOUT_MINUTES: "5"
  1427. with:
  1428. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1429. script: |
  1430. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1431. setupGlobals(core, github, context, exec, io, getOctokit);
  1432. const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs');
  1433. await main();
  1434. detection:
  1435. needs:
  1436. - activation
  1437. - agent
  1438. if: >
  1439. always() && needs.agent.result != 'skipped' && (needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true')
  1440. runs-on: ubuntu-latest
  1441. permissions:
  1442. contents: read
  1443. outputs:
  1444. aic: ${{ steps.parse_detection_token_usage.outputs.aic }}
  1445. detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }}
  1446. detection_reason: ${{ steps.detection_conclusion.outputs.reason }}
  1447. detection_success: ${{ steps.detection_conclusion.outputs.success }}
  1448. steps:
  1449. - name: Setup Scripts
  1450. id: setup
  1451. uses: github/gh-aw-actions/setup@7cfd95b59ca996b7e2bebd6222e21ddd187a4e91 # v0.79.4
  1452. with:
  1453. destination: ${{ runner.temp }}/gh-aw/actions
  1454. job-name: ${{ github.job }}
  1455. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1456. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  1457. env:
  1458. GH_AW_SETUP_WORKFLOW_NAME: "Issue Triage"
  1459. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-triage.lock.yml@${{ github.ref }}
  1460. GH_AW_INFO_VERSION: "0.137.0"
  1461. GH_AW_INFO_AWF_VERSION: "v0.27.0"
  1462. GH_AW_INFO_ENGINE_ID: "codex"
  1463. - name: Download agent output artifact
  1464. id: download-agent-output
  1465. continue-on-error: true
  1466. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  1467. with:
  1468. name: agent
  1469. path: /tmp/gh-aw/
  1470. - name: Setup agent output environment variable
  1471. id: setup-agent-output-env
  1472. if: steps.download-agent-output.outcome == 'success'
  1473. run: |
  1474. mkdir -p /tmp/gh-aw/
  1475. find "/tmp/gh-aw/" -type f -print
  1476. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1477. - name: Checkout repository for patch context
  1478. if: needs.agent.outputs.has_patch == 'true'
  1479. uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
  1480. with:
  1481. persist-credentials: false
  1482. # --- Threat Detection ---
  1483. - name: Clean stale firewall files from agent artifact
  1484. run: |
  1485. rm -rf /tmp/gh-aw/sandbox/firewall/logs
  1486. rm -rf /tmp/gh-aw/sandbox/firewall/audit
  1487. - name: Check if detection needed
  1488. id: detection_guard
  1489. if: always()
  1490. env:
  1491. OUTPUT_TYPES: ${{ needs.agent.outputs.output_types }}
  1492. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  1493. run: |
  1494. if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then
  1495. echo "run_detection=true" >> "$GITHUB_OUTPUT"
  1496. echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH"
  1497. else
  1498. echo "run_detection=false" >> "$GITHUB_OUTPUT"
  1499. echo "Detection skipped: no agent outputs or patches to analyze"
  1500. fi
  1501. - name: Clear MCP Config for detection
  1502. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1503. run: |
  1504. rm -f "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json"
  1505. rm -f /home/runner/.copilot/mcp-config.json
  1506. rm -f "$GITHUB_WORKSPACE/.gemini/settings.json"
  1507. - name: Prepare threat detection files
  1508. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1509. run: |
  1510. mkdir -p /tmp/gh-aw/threat-detection/aw-prompts
  1511. rm -f /tmp/gh-aw/agent_usage.json
  1512. cp /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt 2>/dev/null || true
  1513. if [ ! -s /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt ]; then
  1514. echo "::warning::ERR_VALIDATION: Missing or empty detection context prompt at /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt. Ensure the agent artifact includes /tmp/gh-aw/aw-prompts/prompt.txt. Detection will continue with fallback workflow context."
  1515. fi
  1516. cp /tmp/gh-aw/agent_output.json /tmp/gh-aw/threat-detection/agent_output.json 2>/dev/null || true
  1517. for f in /tmp/gh-aw/aw-*.patch; do
  1518. [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1519. done
  1520. for f in /tmp/gh-aw/aw-*.bundle; do
  1521. [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1522. done
  1523. echo "Prepared threat detection files:"
  1524. ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1525. - name: Setup threat detection
  1526. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1527. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1528. env:
  1529. WORKFLOW_NAME: "Issue Triage"
  1530. WORKFLOW_DESCRIPTION: "对新打开的 issue 进行分类、打标签,并路由到对应的处理工作流"
  1531. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  1532. with:
  1533. script: |
  1534. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1535. setupGlobals(core, github, context, exec, io, getOctokit);
  1536. const { main } = require('${{ runner.temp }}/gh-aw/actions/setup_threat_detection.cjs');
  1537. await main();
  1538. - name: Ensure threat-detection directory and log
  1539. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1540. run: |
  1541. mkdir -p /tmp/gh-aw/threat-detection
  1542. touch /tmp/gh-aw/threat-detection/detection.log
  1543. - name: Setup Node.js
  1544. uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
  1545. with:
  1546. node-version: '24'
  1547. package-manager-cache: false
  1548. - name: Install Codex CLI
  1549. run: npm install --ignore-scripts -g @openai/codex@0.137.0
  1550. - name: Install AWF binary
  1551. run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.0
  1552. - name: Download container images
  1553. run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.0 ghcr.io/github/gh-aw-firewall/api-proxy:0.27.0 ghcr.io/github/gh-aw-firewall/squid:0.27.0 ghcr.io/github/gh-aw-mcpg:v0.3.25@sha256:c10331ad17668ef89f38f5e356678788a40b0cd5fef96e8f92e1d9c1de47cbaa
  1554. - name: Start MCP Gateway
  1555. id: start-mcp-gateway
  1556. env:
  1557. CODEX_HOME: /tmp/gh-aw/mcp-config
  1558. run: |
  1559. set -eo pipefail
  1560. mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config"
  1561. # Export gateway environment variables for MCP config and gateway script
  1562. export MCP_GATEWAY_PORT="8080"
  1563. export MCP_GATEWAY_DOMAIN="host.docker.internal"
  1564. export MCP_GATEWAY_HOST_DOMAIN="localhost"
  1565. MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
  1566. echo "::add-mask::${MCP_GATEWAY_API_KEY}"
  1567. export MCP_GATEWAY_API_KEY
  1568. export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
  1569. mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
  1570. export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
  1571. export DEBUG="*"
  1572. export GH_AW_ENGINE="codex"
  1573. MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')
  1574. MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')
  1575. case "${DOCKER_HOST:-}" in
  1576. unix://* ) DOCKER_SOCK_PATH="${DOCKER_HOST#unix://}" ;;
  1577. /* ) DOCKER_SOCK_PATH="$DOCKER_HOST" ;;
  1578. * ) DOCKER_SOCK_PATH=/var/run/docker.sock ;;
  1579. esac
  1580. DOCKER_SOCK_GID=$(stat -c '%g' "$DOCKER_SOCK_PATH" 2>/dev/null || echo '0')
  1581. export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --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_API_KEY -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_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 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 CODEX_HOME -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 ghcr.io/github/gh-aw-mcpg:v0.3.25'
  1582. cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_9dc1744e356f5fbe_EOF
  1583. [history]
  1584. persistence = "none"
  1585. [shell_environment_policy]
  1586. inherit = "core"
  1587. include_only = ["^CODEX_API_KEY$", "^HOME$", "^OPENAI_API_KEY$", "^PATH$"]
  1588. GH_AW_MCP_CONFIG_9dc1744e356f5fbe_EOF
  1589. # Generate JSON config for MCP gateway
  1590. GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
  1591. cat << GH_AW_MCP_CONFIG_37834a58b4c29838_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
  1592. {
  1593. "mcpServers": {
  1594. },
  1595. "gateway": {
  1596. "port": $MCP_GATEWAY_PORT,
  1597. "domain": "${MCP_GATEWAY_DOMAIN}",
  1598. "apiKey": "${MCP_GATEWAY_API_KEY}",
  1599. "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
  1600. }
  1601. }
  1602. GH_AW_MCP_CONFIG_37834a58b4c29838_EOF
  1603. # Sync converter output to writable CODEX_HOME for Codex
  1604. mkdir -p /tmp/gh-aw/mcp-config
  1605. cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_cb4a4f0f8e96eaf4_EOF
  1606. model_provider = "openai-proxy"
  1607. [model_providers.openai-proxy]
  1608. name = "OpenAI AWF proxy"
  1609. base_url = "http://172.30.0.30:10000"
  1610. env_key = "OPENAI_API_KEY"
  1611. supports_websockets = false
  1612. [shell_environment_policy]
  1613. inherit = "core"
  1614. include_only = ["^CODEX_API_KEY$", "^HOME$", "^OPENAI_API_KEY$", "^PATH$"]
  1615. GH_AW_CODEX_SHELL_POLICY_cb4a4f0f8e96eaf4_EOF
  1616. awk '
  1617. BEGIN { skip_openai_proxy = 0 }
  1618. /^[[:space:]]*model_provider[[:space:]]*=/ { next }
  1619. /^\[model_providers\.openai-proxy\][[:space:]]*$/ { skip_openai_proxy = 1; next }
  1620. /^\[/ { skip_openai_proxy = 0 }
  1621. !skip_openai_proxy { print }
  1622. ' "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" >> "/tmp/gh-aw/mcp-config/config.toml"
  1623. chmod 600 "/tmp/gh-aw/mcp-config/config.toml"
  1624. mkdir -p "${CODEX_HOME}"
  1625. if [ "/tmp/gh-aw/mcp-config/config.toml" != "${CODEX_HOME}/config.toml" ]; then cp "/tmp/gh-aw/mcp-config/config.toml" "${CODEX_HOME}/config.toml"; fi
  1626. chmod 600 "${CODEX_HOME}/config.toml"
  1627. - name: Execute Codex CLI
  1628. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1629. continue-on-error: true
  1630. id: detection_agentic_execution
  1631. run: |
  1632. set -o pipefail
  1633. printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
  1634. mkdir -p "$CODEX_HOME/logs" && touch /tmp/gh-aw/agent-step-summary.md && mkdir -p /tmp/gh-aw/threat-detection && printf '%s' '{"type":"object","properties":{"prompt_injection":{"type":"boolean"},"secret_leak":{"type":"boolean"},"malicious_patch":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["prompt_injection","secret_leak","malicious_patch","reasons"],"additionalProperties":false}' > /tmp/gh-aw/threat-detection/detection_schema.json
  1635. (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log)
  1636. GH_AW_MAX_AI_CREDITS="${{ vars.GH_AW_DEFAULT_MAX_AI_CREDITS || '1000' }}"
  1637. printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.0/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"172.30.0.1\",\"api.openai.com\",\"chatgpt.com\",\"host.docker.internal\",\"openai.com\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"targets\":{\"openai\":{\"host\":\"ai-pixel.online\"}}},\"container\":{\"imageTag\":\"0.27.0\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
  1638. GH_AW_MODEL_MULTIPLIERS_PATH="/tmp/gh-aw/model_multipliers.json" node "${RUNNER_TEMP}/gh-aw/actions/merge_awf_model_multipliers.cjs"
  1639. cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
  1640. export GH_AW_MODELS_JSON_PATH="/tmp/gh-aw/models.json"
  1641. GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS=""
  1642. if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then
  1643. GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS="--docker-host-path-prefix /tmp/gh-aw"
  1644. fi
  1645. GH_AW_TOOL_CACHE_MOUNT=""
  1646. GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"
  1647. if [ -d "$GH_AW_TOOL_CACHE" ]; then
  1648. if [[ "$GH_AW_TOOL_CACHE" != /opt/* ]]; then
  1649. GH_AW_TOOL_CACHE_MOUNT="$GH_AW_TOOL_CACHE:$GH_AW_TOOL_CACHE:ro"
  1650. fi
  1651. elif [ -d "/home/runner/work/_tool" ]; then
  1652. GH_AW_TOOL_CACHE_MOUNT="/home/runner/work/_tool:/home/runner/work/_tool:ro"
  1653. fi
  1654. # shellcheck disable=SC1003
  1655. sudo -E 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_PATH_PREFIX_ARGS} --env-all --exclude-env CODEX_API_KEY --exclude-env OPENAI_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \
  1656. -- /bin/bash -c 'set +o histexpand; GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"; export PATH="$(find "$GH_AW_TOOL_CACHE" /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/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_DETECTION_CODEX:+ --model "$GH_AW_MODEL_DETECTION_CODEX"} -c web_search="disabled" -c fetch="disabled" --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --output-schema /tmp/gh-aw/threat-detection/detection_schema.json -o /tmp/gh-aw/threat-detection/detection_result.json --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log
  1657. env:
  1658. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
  1659. CODEX_HOME: /tmp/gh-aw/mcp-config
  1660. GH_AW_MAX_TURNS: ${{ vars.GH_AW_DEFAULT_MAX_TURNS || '' }}
  1661. GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/config.toml
  1662. GH_AW_MODEL_DETECTION_CODEX: gpt-5.4
  1663. GH_AW_PHASE: detection
  1664. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  1665. GH_AW_VERSION: v0.79.4
  1666. GITHUB_AW: true
  1667. GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
  1668. GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
  1669. GIT_AUTHOR_NAME: github-actions[bot]
  1670. GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
  1671. GIT_COMMITTER_NAME: github-actions[bot]
  1672. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1673. OPENAI_BASE_URL: https://ai-pixel.online
  1674. RUNNER_TEMP: ${{ runner.temp }}
  1675. RUST_LOG: ${{ runner.debug == 1 && 'trace,hyper_util=info,mio=info,reqwest=info,os_info=info,codex_otel=warn,codex_core=debug,ocodex_exec=debug' || 'warn' }}
  1676. - name: Parse threat detection token usage for step summary
  1677. id: parse_detection_token_usage
  1678. if: always()
  1679. continue-on-error: true
  1680. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1681. env:
  1682. GH_AW_TOKEN_USAGE_SUMMARY_TITLE: Threat Detection Token Usage
  1683. with:
  1684. script: |
  1685. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1686. setupGlobals(core, github, context, exec, io, getOctokit);
  1687. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs');
  1688. await main();
  1689. - name: Upload threat detection log
  1690. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1691. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  1692. with:
  1693. name: detection
  1694. path: /tmp/gh-aw/threat-detection/detection.log
  1695. if-no-files-found: ignore
  1696. - name: Parse and conclude threat detection
  1697. id: detection_conclusion
  1698. if: always()
  1699. continue-on-error: true
  1700. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1701. env:
  1702. RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
  1703. DETECTION_AGENTIC_EXECUTION_OUTCOME: ${{ steps.detection_agentic_execution.outcome }}
  1704. GH_AW_DETECTION_CONTINUE_ON_ERROR: "true"
  1705. with:
  1706. script: |
  1707. try {
  1708. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1709. setupGlobals(core, github, context, exec, io, getOctokit);
  1710. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs');
  1711. await main();
  1712. } catch (loadErr) {
  1713. const continueOnError = process.env.GH_AW_DETECTION_CONTINUE_ON_ERROR !== 'false';
  1714. const detectionExecutionFailed = process.env.DETECTION_AGENTIC_EXECUTION_OUTCOME === 'failure';
  1715. const msg = 'ERR_SYSTEM: \u274C Unexpected error loading threat detection module: ' + (loadErr && loadErr.message ? loadErr.message : String(loadErr));
  1716. core.error(msg);
  1717. core.setOutput('reason', 'parse_error');
  1718. if (continueOnError && !detectionExecutionFailed) {
  1719. core.warning('\u26A0\uFE0F ' + msg);
  1720. core.setOutput('conclusion', 'warning');
  1721. core.setOutput('success', 'false');
  1722. } else {
  1723. core.setOutput('conclusion', 'failure');
  1724. core.setOutput('success', 'false');
  1725. core.setFailed(msg);
  1726. }
  1727. }
  1728. safe_outputs:
  1729. needs:
  1730. - activation
  1731. - agent
  1732. - detection
  1733. if: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success'
  1734. runs-on: ubuntu-slim
  1735. permissions:
  1736. contents: read
  1737. discussions: write
  1738. issues: write
  1739. pull-requests: write
  1740. timeout-minutes: 45
  1741. env:
  1742. GH_AW_AGENT_AIC: ${{ needs.agent.outputs.aic }}
  1743. GH_AW_AIC: ${{ needs.agent.outputs.aic }}
  1744. GH_AW_AMBIENT_CONTEXT: ${{ needs.agent.outputs.ambient_context }}
  1745. GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/issue-triage"
  1746. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  1747. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  1748. GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }}
  1749. GH_AW_ENGINE_ID: "codex"
  1750. GH_AW_ENGINE_MODEL: "gpt-5.4"
  1751. GH_AW_THREAT_DETECTION_AIC: ${{ needs.detection.outputs.aic }}
  1752. GH_AW_WORKFLOW_ID: "issue-triage"
  1753. GH_AW_WORKFLOW_NAME: "Issue Triage"
  1754. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/issue-triage.md"
  1755. outputs:
  1756. call_workflow_name: ${{ steps.process_safe_outputs.outputs.call_workflow_name }}
  1757. call_workflow_payload: ${{ steps.process_safe_outputs.outputs.call_workflow_payload }}
  1758. code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }}
  1759. code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }}
  1760. comment_id: ${{ steps.process_safe_outputs.outputs.comment_id }}
  1761. comment_url: ${{ steps.process_safe_outputs.outputs.comment_url }}
  1762. create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}
  1763. create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}
  1764. process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
  1765. process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
  1766. steps:
  1767. - name: Setup Scripts
  1768. id: setup
  1769. uses: github/gh-aw-actions/setup@7cfd95b59ca996b7e2bebd6222e21ddd187a4e91 # v0.79.4
  1770. with:
  1771. destination: ${{ runner.temp }}/gh-aw/actions
  1772. job-name: ${{ github.job }}
  1773. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1774. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  1775. env:
  1776. GH_AW_SETUP_WORKFLOW_NAME: "Issue Triage"
  1777. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/issue-triage.lock.yml@${{ github.ref }}
  1778. GH_AW_INFO_VERSION: "0.137.0"
  1779. GH_AW_INFO_AWF_VERSION: "v0.27.0"
  1780. GH_AW_INFO_ENGINE_ID: "codex"
  1781. - name: Download agent output artifact
  1782. id: download-agent-output
  1783. continue-on-error: true
  1784. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  1785. with:
  1786. name: agent
  1787. path: /tmp/gh-aw/
  1788. - name: Setup agent output environment variable
  1789. id: setup-agent-output-env
  1790. if: steps.download-agent-output.outcome == 'success'
  1791. run: |
  1792. mkdir -p /tmp/gh-aw/
  1793. find "/tmp/gh-aw/" -type f -print
  1794. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1795. - name: Configure GH_HOST for enterprise compatibility
  1796. id: ghes-host-config
  1797. shell: bash
  1798. # zizmor: ignore[github-env] - GITHUB_SERVER_URL is set by GitHub Actions, not user input.
  1799. run: |
  1800. # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct
  1801. # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op.
  1802. GH_HOST="${GITHUB_SERVER_URL#https://}"
  1803. GH_HOST="${GH_HOST#http://}"
  1804. echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV"
  1805. - name: Process Safe Outputs
  1806. id: process_safe_outputs
  1807. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1808. env:
  1809. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1810. GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
  1811. GH_AW_ALLOWED_DOMAINS: "172.30.0.1,ai-pixel.online,api-inference.modelscope.cn,api.commandcode.ai,api.deepseek.com,api.minimaxi.com,api.openai.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,chatgpt.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,host.docker.internal,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,openai.com,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"
  1812. GITHUB_SERVER_URL: ${{ github.server_url }}
  1813. GITHUB_API_URL: ${{ github.api_url }}
  1814. GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1,\"target\":\"triggering\"},\"add_labels\":{\"allowed\":[\"bug\",\"enhancement\",\"question\",\"other\"],\"max\":2,\"target\":\"triggering\"},\"call_workflow\":{\"max\":1,\"workflow_files\":{\"issue-handle-bug\":\"./.github/workflows/issue-handle-bug.lock.yml\",\"issue-handle-enhancement\":\"./.github/workflows/issue-handle-enhancement.lock.yml\",\"issue-handle-other\":\"./.github/workflows/issue-handle-other.lock.yml\",\"issue-handle-question\":\"./.github/workflows/issue-handle-question.lock.yml\"},\"workflows\":[\"issue-handle-bug\",\"issue-handle-enhancement\",\"issue-handle-question\",\"issue-handle-other\"]},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}"
  1815. with:
  1816. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1817. script: |
  1818. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1819. setupGlobals(core, github, context, exec, io, getOctokit);
  1820. const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs');
  1821. await main();
  1822. - name: Upload Safe Outputs Items
  1823. if: always()
  1824. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  1825. with:
  1826. name: safe-outputs-items
  1827. path: |
  1828. /tmp/gh-aw/safe-output-items.jsonl
  1829. /tmp/gh-aw/temporary-id-map.json
  1830. if-no-files-found: ignore