issue-triage.lock.yml 127 KB

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