issue-triage.lock.yml 139 KB

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