weekly-report.lock.yml 113 KB

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