weekly-report.lock.yml 120 KB

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