pr-review-intent.lock.yml 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530
  1. # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"4f9b09824c761259df93e85198cddc36d679de09d9367d090d1f80b30ad39ae7","body_hash":"fc2de9c53c0ecaa9cc183dbac863c4f2e44d941a8fd523c78c985ce9d724a1fc","compiler_version":"v0.77.5","strict":true,"agent_id":"codex","agent_model":"gpt-5.4"}
  2. # gh-aw-manifest: {"version":1,"secrets":["CODEX_API_KEY","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","OPENAI_API_KEY","PIXEL_API_KEY"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"3ea13c02d765410340d533515cb31a7eef2baaf0","version":"v0.77.5"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.58"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.58"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.58"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.22"},{"image":"ghcr.io/github/github-mcp-server:v1.1.0"},{"image":"node:lts-alpine","digest":"sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14","pinned_image":"node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14"}]}
  3. # ___ _ _
  4. # / _ \ | | (_)
  5. # | |_| | __ _ ___ _ __ | |_ _ ___
  6. # | _ |/ _` |/ _ \ '_ \| __| |/ __|
  7. # | | | | (_| | __/ | | | |_| | (__
  8. # \_| |_/\__, |\___|_| |_|\__|_|\___|
  9. # __/ |
  10. # _ _ |___/
  11. # | | | | / _| |
  12. # | | | | ___ _ __ _ __| |_| | _____ ____
  13. # | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___|
  14. # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
  15. # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
  16. #
  17. # This file was automatically generated by gh-aw (v0.77.5). DO NOT EDIT.
  18. #
  19. # To update this file, edit the corresponding .md file and run:
  20. # gh aw compile
  21. # Not all edits will cause changes to this file.
  22. #
  23. # For more information: https://github.github.com/gh-aw/introduction/overview/
  24. #
  25. # 自动审计 Pull Request 的代码意图、隐含约束、实现对齐情况与发布风险
  26. #
  27. # Resolved workflow manifest:
  28. # Imports:
  29. # - shared/engine.md
  30. # - shared/network.md
  31. #
  32. # Secrets used:
  33. # - CODEX_API_KEY
  34. # - GH_AW_GITHUB_MCP_SERVER_TOKEN
  35. # - GH_AW_GITHUB_TOKEN
  36. # - GITHUB_TOKEN
  37. # - OPENAI_API_KEY
  38. # - PIXEL_API_KEY
  39. #
  40. # Custom actions used:
  41. # - actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  42. # - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  43. # - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  44. # - actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
  45. # - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  46. # - github/gh-aw-actions/setup@3ea13c02d765410340d533515cb31a7eef2baaf0 # v0.77.5
  47. #
  48. # Container images used:
  49. # - ghcr.io/github/gh-aw-firewall/agent:0.25.58
  50. # - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.58
  51. # - ghcr.io/github/gh-aw-firewall/squid:0.25.58
  52. # - ghcr.io/github/gh-aw-mcpg:v0.3.22
  53. # - ghcr.io/github/github-mcp-server:v1.1.0
  54. # - node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14
  55. name: "PR Review Intent"
  56. on:
  57. pull_request_target:
  58. branches:
  59. - dev
  60. types:
  61. - opened
  62. - reopened
  63. # roles: all # Roles processed as role check in pre-activation job
  64. permissions: {}
  65. concurrency:
  66. group: "gh-aw-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}"
  67. cancel-in-progress: true
  68. run-name: "PR Review Intent"
  69. jobs:
  70. activation:
  71. runs-on: ubuntu-slim
  72. permissions:
  73. actions: read
  74. contents: read
  75. outputs:
  76. body: ${{ steps.sanitized.outputs.body }}
  77. comment_id: ""
  78. comment_repo: ""
  79. engine_id: ${{ steps.generate_aw_info.outputs.engine_id }}
  80. lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }}
  81. model: ${{ steps.generate_aw_info.outputs.model }}
  82. secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }}
  83. setup-parent-span-id: ${{ steps.setup.outputs.parent-span-id || steps.setup.outputs.span-id }}
  84. setup-span-id: ${{ steps.setup.outputs.span-id }}
  85. setup-trace-id: ${{ steps.setup.outputs.trace-id }}
  86. stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }}
  87. text: ${{ steps.sanitized.outputs.text }}
  88. title: ${{ steps.sanitized.outputs.title }}
  89. steps:
  90. - name: Setup Scripts
  91. id: setup
  92. uses: github/gh-aw-actions/setup@3ea13c02d765410340d533515cb31a7eef2baaf0 # v0.77.5
  93. with:
  94. destination: ${{ runner.temp }}/gh-aw/actions
  95. job-name: ${{ github.job }}
  96. env:
  97. GH_AW_SETUP_WORKFLOW_NAME: "PR Review Intent"
  98. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/pr-review-intent.lock.yml@${{ github.ref }}
  99. GH_AW_INFO_VERSION: "0.135.0"
  100. GH_AW_INFO_AWF_VERSION: "v0.25.58"
  101. GH_AW_INFO_ENGINE_ID: "codex"
  102. - name: Generate agentic run info
  103. id: generate_aw_info
  104. env:
  105. GH_AW_INFO_ENGINE_ID: "codex"
  106. GH_AW_INFO_ENGINE_NAME: "Codex"
  107. GH_AW_INFO_MODEL: "gpt-5.4"
  108. GH_AW_INFO_VERSION: "0.135.0"
  109. GH_AW_INFO_AGENT_VERSION: "0.135.0"
  110. GH_AW_INFO_CLI_VERSION: "v0.77.5"
  111. GH_AW_INFO_WORKFLOW_NAME: "PR Review Intent"
  112. GH_AW_INFO_EXPERIMENTAL: "false"
  113. GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true"
  114. GH_AW_INFO_STAGED: "false"
  115. 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"]'
  116. GH_AW_INFO_FIREWALL_ENABLED: "true"
  117. GH_AW_INFO_AWF_VERSION: "v0.25.58"
  118. GH_AW_INFO_AWMG_VERSION: ""
  119. GH_AW_INFO_FIREWALL_TYPE: "squid"
  120. GH_AW_COMPILED_STRICT: "true"
  121. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  122. with:
  123. script: |
  124. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  125. setupGlobals(core, github, context, exec, io, getOctokit);
  126. const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_aw_info.cjs');
  127. await main(core, context);
  128. - name: Validate CODEX_API_KEY or OPENAI_API_KEY secret
  129. id: validate-secret
  130. 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
  131. env:
  132. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  133. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  134. - name: Checkout .github and .agents folders
  135. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  136. with:
  137. persist-credentials: false
  138. sparse-checkout: |
  139. .github
  140. .agents
  141. .antigravity
  142. .claude
  143. .codex
  144. .crush
  145. .gemini
  146. .opencode
  147. .pi
  148. sparse-checkout-cone-mode: true
  149. fetch-depth: 1
  150. - name: Save agent config folders for base branch restoration
  151. env:
  152. GH_AW_AGENT_FOLDERS: ".agents .antigravity .claude .codex .crush .gemini .github .opencode .pi"
  153. GH_AW_AGENT_FILES: ".crush.json AGENTS.md ANTIGRAVITY.md CLAUDE.md GEMINI.md PI.md opencode.jsonc"
  154. # poutine:ignore untrusted_checkout_exec
  155. run: bash "${RUNNER_TEMP}/gh-aw/actions/save_base_github_folders.sh"
  156. - name: Check workflow lock file
  157. id: check-lock-file
  158. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  159. env:
  160. GH_AW_WORKFLOW_FILE: "pr-review-intent.lock.yml"
  161. GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}"
  162. with:
  163. script: |
  164. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  165. setupGlobals(core, github, context, exec, io, getOctokit);
  166. const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs');
  167. await main();
  168. - name: Check compile-agentic version
  169. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  170. env:
  171. GH_AW_COMPILED_VERSION: "v0.77.5"
  172. with:
  173. script: |
  174. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  175. setupGlobals(core, github, context, exec, io, getOctokit);
  176. const { main } = require('${{ runner.temp }}/gh-aw/actions/check_version_updates.cjs');
  177. await main();
  178. - name: Compute current body text
  179. id: sanitized
  180. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  181. env:
  182. GH_AW_ALLOWED_DOMAINS: "172.30.0.1,ai-pixel.online,api-inference.modelscope.cn,api.commandcode.ai,api.deepseek.com,api.minimaxi.com,api.openai.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,chatgpt.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,open.bigmodel.cn,openai.com,opencode.ai,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,s.symcb.com,s.symcd.com,security.ubuntu.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com"
  183. with:
  184. script: |
  185. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  186. setupGlobals(core, github, context, exec, io, getOctokit);
  187. const { main } = require('${{ runner.temp }}/gh-aw/actions/compute_text.cjs');
  188. await main();
  189. - name: Create prompt with built-in context
  190. env:
  191. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  192. GH_AW_SAFE_OUTPUTS: ${{ runner.temp }}/gh-aw/safeoutputs/outputs.jsonl
  193. 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) }}
  194. 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) }}
  195. 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) }}
  196. GH_AW_EXPR_FF1D34CE: ${{ github.event.comment.id || fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').comment_id }}
  197. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  198. GH_AW_GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
  199. GH_AW_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
  200. GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
  201. GH_AW_GITHUB_EVENT_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
  202. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  203. GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
  204. GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
  205. # poutine:ignore untrusted_checkout_exec
  206. run: |
  207. bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh"
  208. {
  209. cat << 'GH_AW_PROMPT_87d99ff0afb97664_EOF'
  210. <system>
  211. GH_AW_PROMPT_87d99ff0afb97664_EOF
  212. cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md"
  213. cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md"
  214. cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md"
  215. cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md"
  216. cat << 'GH_AW_PROMPT_87d99ff0afb97664_EOF'
  217. <safe-output-tools>
  218. Tools: add_comment, missing_tool, missing_data, noop
  219. </safe-output-tools>
  220. GH_AW_PROMPT_87d99ff0afb97664_EOF
  221. cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md"
  222. cat << 'GH_AW_PROMPT_87d99ff0afb97664_EOF'
  223. <github-context>
  224. The following GitHub context information is available for this workflow:
  225. {{#if github.actor}}
  226. - **actor**: __GH_AW_GITHUB_ACTOR__
  227. {{/if}}
  228. {{#if github.repository}}
  229. - **repository**: __GH_AW_GITHUB_REPOSITORY__
  230. {{/if}}
  231. {{#if github.workspace}}
  232. - **workspace**: __GH_AW_GITHUB_WORKSPACE__
  233. {{/if}}
  234. {{#if github.event.issue.number || (github.aw.context.item_type == 'issue' && github.aw.context.item_number)}}
  235. - **issue-number**: #__GH_AW_EXPR_802A9F6A__
  236. {{/if}}
  237. {{#if github.event.discussion.number || (github.aw.context.item_type == 'discussion' && github.aw.context.item_number)}}
  238. - **discussion-number**: #__GH_AW_EXPR_1A3A194A__
  239. {{/if}}
  240. {{#if github.event.pull_request.number || (github.aw.context.item_type == 'pull_request' && github.aw.context.item_number)}}
  241. - **pull-request-number**: #__GH_AW_EXPR_463A214A__
  242. {{/if}}
  243. {{#if github.event.comment.id || github.aw.context.comment_id}}
  244. - **comment-id**: __GH_AW_EXPR_FF1D34CE__
  245. {{/if}}
  246. {{#if github.run_id}}
  247. - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__
  248. {{/if}}
  249. </github-context>
  250. GH_AW_PROMPT_87d99ff0afb97664_EOF
  251. cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md"
  252. cat << 'GH_AW_PROMPT_87d99ff0afb97664_EOF'
  253. </system>
  254. {{#runtime-import .github/workflows/shared/engine.md}}
  255. {{#runtime-import .github/workflows/shared/network.md}}
  256. {{#runtime-import .github/workflows/pr-review-intent.md}}
  257. GH_AW_PROMPT_87d99ff0afb97664_EOF
  258. } > "$GH_AW_PROMPT"
  259. - name: Interpolate variables and render templates
  260. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  261. env:
  262. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  263. GH_AW_ENGINE_ID: "codex"
  264. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  265. GH_AW_GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
  266. GH_AW_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
  267. GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
  268. GH_AW_GITHUB_EVENT_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
  269. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  270. with:
  271. script: |
  272. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  273. setupGlobals(core, github, context, exec, io, getOctokit);
  274. const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs');
  275. await main();
  276. - name: Substitute placeholders
  277. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  278. env:
  279. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  280. 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) }}
  281. 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) }}
  282. 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) }}
  283. GH_AW_EXPR_FF1D34CE: ${{ github.event.comment.id || fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').comment_id }}
  284. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  285. GH_AW_GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
  286. GH_AW_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
  287. GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
  288. GH_AW_GITHUB_EVENT_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
  289. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  290. GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
  291. GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
  292. GH_AW_MCP_CLI_SERVERS_LIST: '- `safeoutputs` — run `safeoutputs --help` to see available tools'
  293. with:
  294. script: |
  295. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  296. setupGlobals(core, github, context, exec, io, getOctokit);
  297. const substitutePlaceholders = require('${{ runner.temp }}/gh-aw/actions/substitute_placeholders.cjs');
  298. // Call the substitution function
  299. return await substitutePlaceholders({
  300. file: process.env.GH_AW_PROMPT,
  301. substitutions: {
  302. GH_AW_EXPR_1A3A194A: process.env.GH_AW_EXPR_1A3A194A,
  303. GH_AW_EXPR_463A214A: process.env.GH_AW_EXPR_463A214A,
  304. GH_AW_EXPR_802A9F6A: process.env.GH_AW_EXPR_802A9F6A,
  305. GH_AW_EXPR_FF1D34CE: process.env.GH_AW_EXPR_FF1D34CE,
  306. GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR,
  307. GH_AW_GITHUB_EVENT_PULL_REQUEST_BASE_SHA: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_BASE_SHA,
  308. GH_AW_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA,
  309. GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER,
  310. GH_AW_GITHUB_EVENT_PULL_REQUEST_TITLE: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_TITLE,
  311. GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY,
  312. GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID,
  313. GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE,
  314. GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST
  315. }
  316. });
  317. - name: Validate prompt placeholders
  318. env:
  319. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  320. # poutine:ignore untrusted_checkout_exec
  321. run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh"
  322. - name: Print prompt
  323. env:
  324. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  325. # poutine:ignore untrusted_checkout_exec
  326. run: bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh"
  327. - name: Upload activation artifact
  328. if: success()
  329. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  330. with:
  331. name: activation
  332. include-hidden-files: true
  333. path: |
  334. /tmp/gh-aw/aw_info.json
  335. /tmp/gh-aw/model_multipliers.json
  336. /tmp/gh-aw/aw-prompts/prompt.txt
  337. /tmp/gh-aw/aw-prompts/prompt-template.txt
  338. /tmp/gh-aw/aw-prompts/prompt-import-tree.json
  339. /tmp/gh-aw/github_rate_limits.jsonl
  340. /tmp/gh-aw/base
  341. /tmp/gh-aw/.codex/agents
  342. /tmp/gh-aw/.codex/skills
  343. if-no-files-found: ignore
  344. retention-days: 1
  345. agent:
  346. needs: activation
  347. runs-on: ubuntu-latest
  348. permissions:
  349. checks: read
  350. contents: read
  351. issues: read
  352. pull-requests: read
  353. statuses: read
  354. env:
  355. DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
  356. GH_AW_ASSETS_ALLOWED_EXTS: ""
  357. GH_AW_ASSETS_BRANCH: ""
  358. GH_AW_ASSETS_MAX_SIZE_KB: 0
  359. GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
  360. GH_AW_WORKFLOW_ID_SANITIZED: prreviewintent
  361. outputs:
  362. checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }}
  363. effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }}
  364. effective_tokens_rate_limit_error: ${{ steps.parse-mcp-gateway.outputs.effective_tokens_rate_limit_error || 'false' }}
  365. has_patch: ${{ steps.collect_output.outputs.has_patch }}
  366. model: ${{ needs.activation.outputs.model }}
  367. output: ${{ steps.collect_output.outputs.output }}
  368. output_types: ${{ steps.collect_output.outputs.output_types }}
  369. setup-parent-span-id: ${{ steps.setup.outputs.parent-span-id || steps.setup.outputs.span-id }}
  370. setup-span-id: ${{ steps.setup.outputs.span-id }}
  371. setup-trace-id: ${{ steps.setup.outputs.trace-id }}
  372. steps:
  373. - name: Setup Scripts
  374. id: setup
  375. uses: github/gh-aw-actions/setup@3ea13c02d765410340d533515cb31a7eef2baaf0 # v0.77.5
  376. with:
  377. destination: ${{ runner.temp }}/gh-aw/actions
  378. job-name: ${{ github.job }}
  379. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  380. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  381. env:
  382. GH_AW_SETUP_WORKFLOW_NAME: "PR Review Intent"
  383. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/pr-review-intent.lock.yml@${{ github.ref }}
  384. GH_AW_INFO_VERSION: "0.135.0"
  385. GH_AW_INFO_AWF_VERSION: "v0.25.58"
  386. GH_AW_INFO_ENGINE_ID: "codex"
  387. - name: Set runtime paths
  388. id: set-runtime-paths
  389. run: |
  390. {
  391. echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl"
  392. echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json"
  393. echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json"
  394. } >> "$GITHUB_OUTPUT"
  395. - name: Checkout repository
  396. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  397. with:
  398. persist-credentials: false
  399. - name: Create gh-aw temp directory
  400. run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh"
  401. - name: Configure gh CLI for GitHub Enterprise
  402. run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh"
  403. env:
  404. GH_TOKEN: ${{ github.token }}
  405. - name: Configure Git credentials
  406. env:
  407. REPO_NAME: ${{ github.repository }}
  408. SERVER_URL: ${{ github.server_url }}
  409. GITHUB_TOKEN: ${{ github.token }}
  410. run: |
  411. git config --global user.email "github-actions[bot]@users.noreply.github.com"
  412. git config --global user.name "github-actions[bot]"
  413. git config --global am.keepcr true
  414. # Re-authenticate git with GitHub token
  415. SERVER_URL_STRIPPED="${SERVER_URL#https://}"
  416. git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
  417. echo "Git configured with standard GitHub Actions identity"
  418. - name: Checkout PR branch
  419. id: checkout-pr
  420. if: |
  421. github.event.pull_request || github.event.issue.pull_request
  422. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  423. env:
  424. GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  425. with:
  426. github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  427. script: |
  428. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  429. setupGlobals(core, github, context, exec, io, getOctokit);
  430. const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs');
  431. await main();
  432. - name: Setup Node.js
  433. uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
  434. with:
  435. node-version: '24'
  436. package-manager-cache: false
  437. - name: Install Codex CLI
  438. run: npm install --ignore-scripts -g @openai/codex@0.135.0
  439. - name: Install AWF binary
  440. run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.58
  441. - name: Parse integrity filter lists
  442. id: parse-guard-vars
  443. env:
  444. GH_AW_BLOCKED_USERS_VAR: ${{ vars.GH_AW_GITHUB_BLOCKED_USERS || '' }}
  445. GH_AW_TRUSTED_USERS_VAR: ${{ vars.GH_AW_GITHUB_TRUSTED_USERS || '' }}
  446. GH_AW_APPROVAL_LABELS_VAR: ${{ vars.GH_AW_GITHUB_APPROVAL_LABELS || '' }}
  447. run: bash "${RUNNER_TEMP}/gh-aw/actions/parse_guard_list.sh"
  448. - name: Download activation artifact
  449. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  450. with:
  451. name: activation
  452. path: /tmp/gh-aw
  453. - name: Restore agent config folders from base branch
  454. if: steps.checkout-pr.outcome == 'success'
  455. env:
  456. GH_AW_AGENT_FOLDERS: ".agents .antigravity .claude .codex .crush .gemini .github .opencode .pi"
  457. GH_AW_AGENT_FILES: ".crush.json AGENTS.md ANTIGRAVITY.md CLAUDE.md GEMINI.md PI.md opencode.jsonc"
  458. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh"
  459. - name: Restore inline sub-agents from activation artifact
  460. env:
  461. GH_AW_SUB_AGENT_DIR: ".codex/agents"
  462. GH_AW_SUB_AGENT_EXT: ".md"
  463. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_sub_agents.sh"
  464. - name: Restore inline skills from activation artifact
  465. env:
  466. GH_AW_SKILL_DIR: ".codex/skills"
  467. run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_skills.sh"
  468. - name: Download container images
  469. run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.58 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.58 ghcr.io/github/gh-aw-firewall/squid:0.25.58 ghcr.io/github/gh-aw-mcpg:v0.3.22 ghcr.io/github/github-mcp-server:v1.1.0 node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14
  470. - name: Generate Safe Outputs Config
  471. run: |
  472. mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"
  473. mkdir -p /tmp/gh-aw/safeoutputs
  474. mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
  475. cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_c9f856230444f12e_EOF'
  476. {"add_comment":{"max":1,"target":"triggering"},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}}
  477. GH_AW_SAFE_OUTPUTS_CONFIG_c9f856230444f12e_EOF
  478. - name: Generate Safe Outputs Tools
  479. env:
  480. GH_AW_TOOLS_META_JSON: |
  481. {
  482. "description_suffixes": {
  483. "add_comment": " CONSTRAINTS: Maximum 1 comment(s) can be added. Target: triggering. Supports reply_to_id for discussion threading."
  484. },
  485. "repo_params": {},
  486. "dynamic_tools": []
  487. }
  488. GH_AW_VALIDATION_JSON: |
  489. {
  490. "add_comment": {
  491. "defaultMax": 1,
  492. "fields": {
  493. "body": {
  494. "required": true,
  495. "type": "string",
  496. "sanitize": true,
  497. "maxLength": 65000
  498. },
  499. "item_number": {
  500. "issueOrPRNumber": true
  501. },
  502. "reply_to_id": {
  503. "type": "string",
  504. "maxLength": 256
  505. },
  506. "repo": {
  507. "type": "string",
  508. "maxLength": 256
  509. }
  510. }
  511. },
  512. "missing_data": {
  513. "defaultMax": 20,
  514. "fields": {
  515. "alternatives": {
  516. "type": "string",
  517. "sanitize": true,
  518. "maxLength": 256
  519. },
  520. "context": {
  521. "type": "string",
  522. "sanitize": true,
  523. "maxLength": 256
  524. },
  525. "data_type": {
  526. "type": "string",
  527. "sanitize": true,
  528. "maxLength": 128
  529. },
  530. "reason": {
  531. "type": "string",
  532. "sanitize": true,
  533. "maxLength": 256
  534. }
  535. }
  536. },
  537. "missing_tool": {
  538. "defaultMax": 20,
  539. "fields": {
  540. "alternatives": {
  541. "type": "string",
  542. "sanitize": true,
  543. "maxLength": 512
  544. },
  545. "reason": {
  546. "required": true,
  547. "type": "string",
  548. "sanitize": true,
  549. "maxLength": 256
  550. },
  551. "tool": {
  552. "type": "string",
  553. "sanitize": true,
  554. "maxLength": 128
  555. }
  556. }
  557. },
  558. "noop": {
  559. "defaultMax": 1,
  560. "fields": {
  561. "message": {
  562. "required": true,
  563. "type": "string",
  564. "sanitize": true,
  565. "maxLength": 65000
  566. }
  567. }
  568. },
  569. "report_incomplete": {
  570. "defaultMax": 5,
  571. "fields": {
  572. "details": {
  573. "type": "string",
  574. "sanitize": true,
  575. "maxLength": 65000
  576. },
  577. "reason": {
  578. "required": true,
  579. "type": "string",
  580. "sanitize": true,
  581. "maxLength": 1024
  582. }
  583. }
  584. }
  585. }
  586. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  587. with:
  588. script: |
  589. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  590. setupGlobals(core, github, context, exec, io, getOctokit);
  591. const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_safe_outputs_tools.cjs');
  592. await main();
  593. - name: Generate Safe Outputs MCP Server Config
  594. id: safe-outputs-config
  595. run: |
  596. # Generate a secure random API key (360 bits of entropy, 40+ chars)
  597. # Mask immediately to prevent timing vulnerabilities
  598. API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
  599. echo "::add-mask::${API_KEY}"
  600. PORT=3001
  601. # Set outputs for next steps
  602. {
  603. echo "safe_outputs_api_key=${API_KEY}"
  604. echo "safe_outputs_port=${PORT}"
  605. } >> "$GITHUB_OUTPUT"
  606. echo "Safe Outputs MCP server will run on port ${PORT}"
  607. - name: Start Safe Outputs MCP HTTP Server
  608. id: safe-outputs-start
  609. env:
  610. DEBUG: '*'
  611. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  612. GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }}
  613. GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }}
  614. GH_AW_SAFE_OUTPUTS_TOOLS_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/tools.json
  615. GH_AW_SAFE_OUTPUTS_CONFIG_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/config.json
  616. GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
  617. run: |
  618. # Environment variables are set above to prevent template injection
  619. export DEBUG
  620. export GH_AW_SAFE_OUTPUTS
  621. export GH_AW_SAFE_OUTPUTS_PORT
  622. export GH_AW_SAFE_OUTPUTS_API_KEY
  623. export GH_AW_SAFE_OUTPUTS_TOOLS_PATH
  624. export GH_AW_SAFE_OUTPUTS_CONFIG_PATH
  625. export GH_AW_MCP_LOG_DIR
  626. bash "${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh"
  627. - name: Start MCP Gateway
  628. id: start-mcp-gateway
  629. env:
  630. CODEX_HOME: /tmp/gh-aw/mcp-config
  631. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  632. GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }}
  633. GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }}
  634. GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  635. run: |
  636. set -eo pipefail
  637. mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config"
  638. # Export gateway environment variables for MCP config and gateway script
  639. export MCP_GATEWAY_PORT="8080"
  640. export MCP_GATEWAY_DOMAIN="host.docker.internal"
  641. export MCP_GATEWAY_HOST_DOMAIN="localhost"
  642. MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
  643. echo "::add-mask::${MCP_GATEWAY_API_KEY}"
  644. export MCP_GATEWAY_API_KEY
  645. export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
  646. mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
  647. export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
  648. export DEBUG="*"
  649. export GH_AW_ENGINE="codex"
  650. MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')
  651. MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')
  652. case "${DOCKER_HOST:-}" in
  653. unix://* ) DOCKER_SOCK_PATH="${DOCKER_HOST#unix://}" ;;
  654. /* ) DOCKER_SOCK_PATH="$DOCKER_HOST" ;;
  655. * ) DOCKER_SOCK_PATH=/var/run/docker.sock ;;
  656. esac
  657. DOCKER_SOCK_GID=$(stat -c '%g' "$DOCKER_SOCK_PATH" 2>/dev/null || echo '0')
  658. export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.22'
  659. cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_d15f5801fc442b65_EOF
  660. [history]
  661. persistence = "none"
  662. [shell_environment_policy]
  663. inherit = "core"
  664. 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$"]
  665. [mcp_servers.github]
  666. user_agent = "pr-review-intent"
  667. startup_timeout_sec = 120
  668. tool_timeout_sec = 60
  669. container = "ghcr.io/github/github-mcp-server:v1.1.0"
  670. env = { "GITHUB_HOST" = "$GITHUB_SERVER_URL", "GITHUB_PERSONAL_ACCESS_TOKEN" = "$GH_AW_GITHUB_TOKEN", "GITHUB_READ_ONLY" = "1", "GITHUB_TOOLSETS" = "context,repos,issues,pull_requests" }
  671. env_vars = ["GITHUB_HOST", "GITHUB_PERSONAL_ACCESS_TOKEN", "GITHUB_READ_ONLY", "GITHUB_TOOLSETS"]
  672. [mcp_servers.safeoutputs]
  673. type = "http"
  674. url = "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT"
  675. [mcp_servers.safeoutputs.headers]
  676. Authorization = "$GH_AW_SAFE_OUTPUTS_API_KEY"
  677. [mcp_servers.safeoutputs."guard-policies"]
  678. [mcp_servers.safeoutputs."guard-policies".write-sink]
  679. accept = ["*"]
  680. GH_AW_MCP_CONFIG_d15f5801fc442b65_EOF
  681. # Generate JSON config for MCP gateway
  682. GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
  683. cat << GH_AW_MCP_CONFIG_d15f5801fc442b65_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
  684. {
  685. "mcpServers": {
  686. "github": {
  687. "container": "ghcr.io/github/github-mcp-server:v1.1.0",
  688. "env": {
  689. "GITHUB_HOST": "$GITHUB_SERVER_URL",
  690. "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_MCP_SERVER_TOKEN",
  691. "GITHUB_READ_ONLY": "1",
  692. "GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
  693. },
  694. "guard-policies": {
  695. "allow-only": {
  696. "approval-labels": ${{ steps.parse-guard-vars.outputs.approval_labels }},
  697. "blocked-users": ${{ steps.parse-guard-vars.outputs.blocked_users }},
  698. "min-integrity": "none",
  699. "repos": "all",
  700. "trusted-users": ${{ steps.parse-guard-vars.outputs.trusted_users }}
  701. }
  702. }
  703. },
  704. "safeoutputs": {
  705. "type": "http",
  706. "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT",
  707. "headers": {
  708. "Authorization": "$GH_AW_SAFE_OUTPUTS_API_KEY"
  709. },
  710. "guard-policies": {
  711. "write-sink": {
  712. "accept": [
  713. "*"
  714. ]
  715. }
  716. }
  717. }
  718. },
  719. "gateway": {
  720. "port": $MCP_GATEWAY_PORT,
  721. "domain": "${MCP_GATEWAY_DOMAIN}",
  722. "apiKey": "${MCP_GATEWAY_API_KEY}",
  723. "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
  724. }
  725. }
  726. GH_AW_MCP_CONFIG_d15f5801fc442b65_EOF
  727. # Sync converter output to writable CODEX_HOME for Codex
  728. mkdir -p /tmp/gh-aw/mcp-config
  729. cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_1eaa3e7a2c82d164_EOF
  730. model_provider = "openai-proxy"
  731. [model_providers.openai-proxy]
  732. name = "OpenAI AWF proxy"
  733. base_url = "http://172.30.0.30:10000"
  734. env_key = "OPENAI_API_KEY"
  735. supports_websockets = false
  736. [shell_environment_policy]
  737. inherit = "core"
  738. 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$"]
  739. GH_AW_CODEX_SHELL_POLICY_1eaa3e7a2c82d164_EOF
  740. awk '
  741. BEGIN { skip_openai_proxy = 0 }
  742. /^[[:space:]]*model_provider[[:space:]]*=/ { next }
  743. /^\[model_providers\.openai-proxy\][[:space:]]*$/ { skip_openai_proxy = 1; next }
  744. /^\[/ { skip_openai_proxy = 0 }
  745. !skip_openai_proxy { print }
  746. ' "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" >> "/tmp/gh-aw/mcp-config/config.toml"
  747. chmod 600 "/tmp/gh-aw/mcp-config/config.toml"
  748. mkdir -p "${CODEX_HOME}"
  749. 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
  750. chmod 600 "${CODEX_HOME}/config.toml"
  751. - name: Mount MCP servers as CLIs
  752. id: mount-mcp-clis
  753. continue-on-error: true
  754. env:
  755. MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
  756. MCP_GATEWAY_DOMAIN: ${{ steps.start-mcp-gateway.outputs.gateway-domain }}
  757. MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
  758. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  759. with:
  760. script: |
  761. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  762. setupGlobals(core, github, context, exec, io);
  763. const { main } = require('${{ runner.temp }}/gh-aw/actions/mount_mcp_as_cli.cjs');
  764. await main();
  765. - name: Clean credentials
  766. continue-on-error: true
  767. run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh"
  768. - name: Audit pre-agent workspace
  769. id: pre_agent_audit
  770. continue-on-error: true
  771. run: bash "${RUNNER_TEMP}/gh-aw/actions/audit_pre_agent_workspace.sh"
  772. - name: Execute Codex CLI
  773. id: agentic_execution
  774. run: |
  775. set -o pipefail
  776. printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
  777. mkdir -p "$CODEX_HOME/logs" && touch /tmp/gh-aw/agent-step-summary.md
  778. (umask 177 && touch /tmp/gh-aw/agent-stdio.log)
  779. printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.58/awf-config.schema.json","network":{"allowDomains":["172.30.0.1","ai-pixel.online","api-inference.modelscope.cn","api.commandcode.ai","api.deepseek.com","api.minimaxi.com","api.openai.com","api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","chatgpt.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","host.docker.internal","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","open.bigmodel.cn","openai.com","opencode.ai","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","s.symcb.com","s.symcd.com","security.ubuntu.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"]},"apiProxy":{"enabled":true,"enableTokenSteering":true,"maxRuns":500,"maxEffectiveTokens":25000000,"targets":{"openai":{"host":"ai-pixel.online"}},"models":{"agent":["sonnet-6x","gpt-5.4","gpt-5.3","gemini-pro","any"],"antigravity":["copilot/antigravity*","google/antigravity*","gemini/antigravity*"],"any":["copilot/*","anthropic/*","openai/*","google/*","gemini/*"],"claude":["agent"],"codex":["agent"],"coding":["copilot/gpt-5*codex*","openai/gpt-5*codex*","gpt-5-codex"],"computer-use":["copilot/*computer-use*","google/*computer-use*","gemini/*computer-use*","openai/*computer-use*"],"copilot":["agent"],"deep-research":["copilot/deep-research*","copilot/o3-deep-research*","copilot/o4-mini-deep-research*","google/deep-research*","gemini/deep-research*","openai/o3-deep-research*","openai/o4-mini-deep-research*"],"gemini":["agent"],"gemini-3-flash":["copilot/gemini-3*flash*","google/gemini-3*flash*","gemini/gemini-3*flash*"],"gemini-3-pro":["copilot/gemini-3*pro*","google/gemini-3*pro*","gemini/gemini-3*pro*"],"gemini-3.1-flash":["copilot/gemini-3.1*flash*","google/gemini-3.1*flash*","gemini/gemini-3.1*flash*"],"gemini-3.1-pro":["copilot/gemini-3.1*pro*","google/gemini-3.1*pro*","gemini/gemini-3.1*pro*"],"gemini-3.5-flash":["copilot/gemini-3.5*flash*","google/gemini-3.5*flash*","gemini/gemini-3.5*flash*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*","gemini/gemini-*flash*"],"gemini-flash-lite":["copilot/gemini-*flash*lite*","google/gemini-*flash*lite*","gemini/gemini-*flash*lite*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*","gemini/gemini-*pro*"],"gemma":["copilot/gemma*","google/gemma*","gemini/gemma*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"gpt-5.2":["copilot/gpt-5.2*","openai/gpt-5.2*"],"gpt-5.3":["copilot/gpt-5.3*","openai/gpt-5.3*"],"gpt-5.4":["copilot/gpt-5.4*","openai/gpt-5.4*"],"gpt-5.5":["copilot/gpt-5.5*","openai/gpt-5.5*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"large":["sonnet","gpt-5-pro","gpt-5","gemini-pro"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash-lite"],"opus":["copilot/*opus*","anthropic/*opus*"],"opusplan":["opus?effort=high"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"robotics":["copilot/*robotics*","google/*robotics*","gemini/*robotics*"],"small":["mini"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"],"sonnet-6x":["copilot/*sonnet-4-5-*","anthropic/*sonnet-4-5-*","copilot/*sonnet-4-6*","anthropic/*sonnet-4-6*"],"summarization":["haiku","gpt-5-mini","gemini-flash-lite","mini"],"vision":["copilot/gemini-*image*","gemini/gemini-*image*","copilot/gemini-*flash*","gemini/gemini-*flash*"]}},"container":{"imageTag":"0.25.58"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json"
  780. GH_AW_MODEL_MULTIPLIERS_PATH="/tmp/gh-aw/model_multipliers.json" node "${RUNNER_TEMP}/gh-aw/actions/merge_awf_model_multipliers.cjs"
  781. cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
  782. GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS=""
  783. if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then
  784. GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS="--docker-host-path-prefix /tmp/gh-aw"
  785. fi
  786. GH_AW_TOOL_CACHE_MOUNT=""
  787. GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"
  788. if [ -d "$GH_AW_TOOL_CACHE" ]; then
  789. if [[ "$GH_AW_TOOL_CACHE" != /opt/* ]]; then
  790. GH_AW_TOOL_CACHE_MOUNT="$GH_AW_TOOL_CACHE:$GH_AW_TOOL_CACHE:ro"
  791. fi
  792. elif [ -d "/home/runner/work/_tool" ]; then
  793. GH_AW_TOOL_CACHE_MOUNT="/home/runner/work/_tool:/home/runner/work/_tool:ro"
  794. fi
  795. # shellcheck disable=SC1003
  796. sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" ${GH_AW_TOOL_CACHE_MOUNT:+--mount "$GH_AW_TOOL_CACHE_MOUNT"} ${GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS} --env-all --exclude-env CODEX_API_KEY --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --exclude-env OPENAI_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \
  797. -- /bin/bash -c 'set +o histexpand; export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"; export PATH="$(find "$GH_AW_TOOL_CACHE" /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/codex_harness.cjs codex exec${GH_AW_MODEL_AGENT_CODEX:+ --model "$GH_AW_MODEL_AGENT_CODEX"} -c web_search="disabled" -c fetch="disabled" --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
  798. env:
  799. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
  800. CODEX_HOME: /tmp/gh-aw/mcp-config
  801. GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/config.toml
  802. GH_AW_MODEL_AGENT_CODEX: gpt-5.4
  803. GH_AW_PHASE: agent
  804. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  805. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  806. GH_AW_VERSION: v0.77.5
  807. GITHUB_AW: true
  808. GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
  809. GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
  810. GIT_AUTHOR_NAME: github-actions[bot]
  811. GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
  812. GIT_COMMITTER_NAME: github-actions[bot]
  813. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  814. OPENAI_BASE_URL: https://ai-pixel.online
  815. RUNNER_TEMP: ${{ runner.temp }}
  816. RUST_LOG: ${{ runner.debug == 1 && 'trace,hyper_util=info,mio=info,reqwest=info,os_info=info,codex_otel=warn,codex_core=debug,ocodex_exec=debug' || 'warn' }}
  817. - name: Configure Git credentials
  818. env:
  819. REPO_NAME: ${{ github.repository }}
  820. SERVER_URL: ${{ github.server_url }}
  821. GITHUB_TOKEN: ${{ github.token }}
  822. run: |
  823. git config --global user.email "github-actions[bot]@users.noreply.github.com"
  824. git config --global user.name "github-actions[bot]"
  825. git config --global am.keepcr true
  826. # Re-authenticate git with GitHub token
  827. SERVER_URL_STRIPPED="${SERVER_URL#https://}"
  828. git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
  829. echo "Git configured with standard GitHub Actions identity"
  830. - name: Stop MCP Gateway
  831. if: always()
  832. continue-on-error: true
  833. env:
  834. MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
  835. MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
  836. GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }}
  837. run: |
  838. bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID"
  839. - name: Redact secrets in logs
  840. if: always()
  841. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  842. with:
  843. script: |
  844. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  845. setupGlobals(core, github, context, exec, io, getOctokit);
  846. const { main } = require('${{ runner.temp }}/gh-aw/actions/redact_secrets.cjs');
  847. await main();
  848. env:
  849. 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'
  850. SECRET_CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  851. SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  852. SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  853. SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  854. SECRET_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  855. SECRET_PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  856. - name: Append agent step summary
  857. if: always()
  858. run: bash "${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh"
  859. - name: Copy Safe Outputs
  860. if: always()
  861. env:
  862. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  863. run: |
  864. mkdir -p /tmp/gh-aw
  865. cp "$GH_AW_SAFE_OUTPUTS" /tmp/gh-aw/safeoutputs.jsonl 2>/dev/null || true
  866. - name: Ingest agent output
  867. id: collect_output
  868. if: always()
  869. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  870. env:
  871. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  872. GH_AW_ALLOWED_DOMAINS: "172.30.0.1,ai-pixel.online,api-inference.modelscope.cn,api.commandcode.ai,api.deepseek.com,api.minimaxi.com,api.openai.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,chatgpt.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,open.bigmodel.cn,openai.com,opencode.ai,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,s.symcb.com,s.symcd.com,security.ubuntu.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com"
  873. GITHUB_SERVER_URL: ${{ github.server_url }}
  874. GITHUB_API_URL: ${{ github.api_url }}
  875. with:
  876. script: |
  877. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  878. setupGlobals(core, github, context, exec, io, getOctokit);
  879. const { main } = require('${{ runner.temp }}/gh-aw/actions/collect_ndjson_output.cjs');
  880. await main();
  881. - name: Parse agent logs for step summary
  882. if: always()
  883. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  884. env:
  885. GH_AW_AGENT_OUTPUT: /tmp/gh-aw/agent-stdio.log
  886. with:
  887. script: |
  888. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  889. setupGlobals(core, github, context, exec, io, getOctokit);
  890. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_codex_log.cjs');
  891. await main();
  892. - name: Parse MCP Gateway logs for step summary
  893. if: always()
  894. id: parse-mcp-gateway
  895. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  896. with:
  897. script: |
  898. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  899. setupGlobals(core, github, context, exec, io, getOctokit);
  900. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_mcp_gateway_log.cjs');
  901. await main();
  902. - name: Print firewall logs
  903. if: always()
  904. continue-on-error: true
  905. env:
  906. AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
  907. run: |
  908. # Fix permissions on firewall logs/audit dirs so they can be uploaded as artifacts
  909. # AWF runs with sudo, creating files owned by root
  910. sudo chmod -R a+rX /tmp/gh-aw/sandbox/firewall 2>/dev/null || true
  911. # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step)
  912. if command -v awf &> /dev/null; then
  913. awf logs summary | tee -a "$GITHUB_STEP_SUMMARY"
  914. else
  915. echo 'AWF binary not installed, skipping firewall log summary'
  916. fi
  917. - name: Parse token usage for step summary
  918. if: always()
  919. continue-on-error: true
  920. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  921. with:
  922. script: |
  923. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  924. setupGlobals(core, github, context, exec, io, getOctokit);
  925. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs');
  926. await main();
  927. - name: Print AWF reflect summary
  928. if: always()
  929. continue-on-error: true
  930. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  931. with:
  932. script: |
  933. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  934. setupGlobals(core, github, context, exec, io, getOctokit);
  935. const { main } = require('${{ runner.temp }}/gh-aw/actions/awf_reflect_summary.cjs');
  936. await main();
  937. - name: Write agent output placeholder if missing
  938. if: always()
  939. run: |
  940. if [ ! -f /tmp/gh-aw/agent_output.json ]; then
  941. echo '{"items":[]}' > /tmp/gh-aw/agent_output.json
  942. fi
  943. - name: Upload agent artifacts
  944. if: always()
  945. continue-on-error: true
  946. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  947. with:
  948. name: agent
  949. path: |
  950. /tmp/gh-aw/aw-prompts/prompt.txt
  951. /tmp/gh-aw/mcp-config/logs/
  952. /tmp/gh-aw/redacted-urls.log
  953. /tmp/gh-aw/mcp-logs/
  954. /tmp/gh-aw/proxy-logs/
  955. !/tmp/gh-aw/proxy-logs/proxy-tls/
  956. /tmp/gh-aw/agent_usage.json
  957. /tmp/gh-aw/agent-stdio.log
  958. /tmp/gh-aw/pre-agent-audit.txt
  959. /tmp/gh-aw/agent/
  960. /tmp/gh-aw/github_rate_limits.jsonl
  961. /tmp/gh-aw/safeoutputs.jsonl
  962. /tmp/gh-aw/agent_output.json
  963. /tmp/gh-aw/aw-*.patch
  964. /tmp/gh-aw/aw-*.bundle
  965. /tmp/gh-aw/awf-config.json
  966. /tmp/gh-aw/sandbox/firewall/logs/
  967. /tmp/gh-aw/sandbox/firewall/audit/
  968. /tmp/gh-aw/sandbox/firewall/awf-reflect.json
  969. if-no-files-found: ignore
  970. conclusion:
  971. needs:
  972. - activation
  973. - agent
  974. - detection
  975. - safe_outputs
  976. if: >
  977. always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' ||
  978. needs.activation.outputs.stale_lock_file_failed == 'true')
  979. runs-on: ubuntu-slim
  980. permissions:
  981. contents: read
  982. discussions: write
  983. issues: write
  984. pull-requests: write
  985. concurrency:
  986. group: "gh-aw-conclusion-pr-review-intent"
  987. cancel-in-progress: false
  988. queue: max
  989. outputs:
  990. incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }}
  991. noop_message: ${{ steps.noop.outputs.noop_message }}
  992. tools_reported: ${{ steps.missing_tool.outputs.tools_reported }}
  993. total_count: ${{ steps.missing_tool.outputs.total_count }}
  994. steps:
  995. - name: Setup Scripts
  996. id: setup
  997. uses: github/gh-aw-actions/setup@3ea13c02d765410340d533515cb31a7eef2baaf0 # v0.77.5
  998. with:
  999. destination: ${{ runner.temp }}/gh-aw/actions
  1000. job-name: ${{ github.job }}
  1001. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1002. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  1003. env:
  1004. GH_AW_SETUP_WORKFLOW_NAME: "PR Review Intent"
  1005. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/pr-review-intent.lock.yml@${{ github.ref }}
  1006. GH_AW_INFO_VERSION: "0.135.0"
  1007. GH_AW_INFO_AWF_VERSION: "v0.25.58"
  1008. GH_AW_INFO_ENGINE_ID: "codex"
  1009. - name: Download agent output artifact
  1010. id: download-agent-output
  1011. continue-on-error: true
  1012. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  1013. with:
  1014. name: agent
  1015. path: /tmp/gh-aw/
  1016. - name: Setup agent output environment variable
  1017. id: setup-agent-output-env
  1018. if: steps.download-agent-output.outcome == 'success'
  1019. run: |
  1020. mkdir -p /tmp/gh-aw/
  1021. find "/tmp/gh-aw/" -type f -print
  1022. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1023. - name: Process no-op messages
  1024. id: noop
  1025. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1026. env:
  1027. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1028. GH_AW_NOOP_MAX: "1"
  1029. GH_AW_WORKFLOW_NAME: "PR Review Intent"
  1030. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/pr-review-intent.md"
  1031. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1032. GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
  1033. GH_AW_NOOP_REPORT_AS_ISSUE: "true"
  1034. with:
  1035. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1036. script: |
  1037. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1038. setupGlobals(core, github, context, exec, io, getOctokit);
  1039. const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs');
  1040. await main();
  1041. - name: Log detection run
  1042. id: detection_runs
  1043. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1044. env:
  1045. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1046. GH_AW_WORKFLOW_NAME: "PR Review Intent"
  1047. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/pr-review-intent.md"
  1048. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1049. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  1050. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  1051. with:
  1052. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1053. script: |
  1054. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1055. setupGlobals(core, github, context, exec, io, getOctokit);
  1056. const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_detection_runs.cjs');
  1057. await main();
  1058. - name: Record missing tool
  1059. id: missing_tool
  1060. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1061. env:
  1062. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1063. GH_AW_MISSING_TOOL_CREATE_ISSUE: "true"
  1064. GH_AW_WORKFLOW_NAME: "PR Review Intent"
  1065. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/pr-review-intent.md"
  1066. with:
  1067. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1068. script: |
  1069. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1070. setupGlobals(core, github, context, exec, io, getOctokit);
  1071. const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs');
  1072. await main();
  1073. - name: Record incomplete
  1074. id: report_incomplete
  1075. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1076. env:
  1077. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1078. GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true"
  1079. GH_AW_WORKFLOW_NAME: "PR Review Intent"
  1080. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/pr-review-intent.md"
  1081. with:
  1082. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1083. script: |
  1084. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1085. setupGlobals(core, github, context, exec, io, getOctokit);
  1086. const { main } = require('${{ runner.temp }}/gh-aw/actions/report_incomplete_handler.cjs');
  1087. await main();
  1088. - name: Handle agent failure
  1089. id: handle_agent_failure
  1090. if: always()
  1091. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1092. env:
  1093. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1094. GH_AW_WORKFLOW_NAME: "PR Review Intent"
  1095. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/pr-review-intent.md"
  1096. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  1097. GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
  1098. GH_AW_WORKFLOW_ID: "pr-review-intent"
  1099. GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168"
  1100. GH_AW_ENGINE_ID: "codex"
  1101. GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
  1102. GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
  1103. GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens || '' }}
  1104. GH_AW_EFFECTIVE_TOKENS_RATE_LIMIT_ERROR: ${{ needs.agent.outputs.effective_tokens_rate_limit_error || 'false' }}
  1105. GH_AW_ENGINE_API_HOSTS: "api.openai.com"
  1106. GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }}
  1107. GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }}
  1108. GH_AW_GROUP_REPORTS: "false"
  1109. GH_AW_FAILURE_REPORT_AS_ISSUE: "true"
  1110. GH_AW_MISSING_TOOL_REPORT_AS_FAILURE: "true"
  1111. GH_AW_MISSING_DATA_REPORT_AS_FAILURE: "true"
  1112. GH_AW_TIMEOUT_MINUTES: "15"
  1113. GH_AW_MAX_EFFECTIVE_TOKENS: "25000000"
  1114. with:
  1115. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1116. script: |
  1117. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1118. setupGlobals(core, github, context, exec, io, getOctokit);
  1119. const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs');
  1120. await main();
  1121. detection:
  1122. needs:
  1123. - activation
  1124. - agent
  1125. if: >
  1126. always() && needs.agent.result != 'skipped' && (needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true')
  1127. runs-on: ubuntu-latest
  1128. permissions:
  1129. contents: read
  1130. outputs:
  1131. detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }}
  1132. detection_reason: ${{ steps.detection_conclusion.outputs.reason }}
  1133. detection_success: ${{ steps.detection_conclusion.outputs.success }}
  1134. steps:
  1135. - name: Setup Scripts
  1136. id: setup
  1137. uses: github/gh-aw-actions/setup@3ea13c02d765410340d533515cb31a7eef2baaf0 # v0.77.5
  1138. with:
  1139. destination: ${{ runner.temp }}/gh-aw/actions
  1140. job-name: ${{ github.job }}
  1141. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1142. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  1143. env:
  1144. GH_AW_SETUP_WORKFLOW_NAME: "PR Review Intent"
  1145. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/pr-review-intent.lock.yml@${{ github.ref }}
  1146. GH_AW_INFO_VERSION: "0.135.0"
  1147. GH_AW_INFO_AWF_VERSION: "v0.25.58"
  1148. GH_AW_INFO_ENGINE_ID: "codex"
  1149. - name: Download agent output artifact
  1150. id: download-agent-output
  1151. continue-on-error: true
  1152. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  1153. with:
  1154. name: agent
  1155. path: /tmp/gh-aw/
  1156. - name: Setup agent output environment variable
  1157. id: setup-agent-output-env
  1158. if: steps.download-agent-output.outcome == 'success'
  1159. run: |
  1160. mkdir -p /tmp/gh-aw/
  1161. find "/tmp/gh-aw/" -type f -print
  1162. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1163. - name: Checkout repository for patch context
  1164. if: needs.agent.outputs.has_patch == 'true'
  1165. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  1166. with:
  1167. persist-credentials: false
  1168. # --- Threat Detection ---
  1169. - name: Clean stale firewall files from agent artifact
  1170. run: |
  1171. rm -rf /tmp/gh-aw/sandbox/firewall/logs
  1172. rm -rf /tmp/gh-aw/sandbox/firewall/audit
  1173. - name: Check if detection needed
  1174. id: detection_guard
  1175. if: always()
  1176. env:
  1177. OUTPUT_TYPES: ${{ needs.agent.outputs.output_types }}
  1178. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  1179. run: |
  1180. if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then
  1181. echo "run_detection=true" >> "$GITHUB_OUTPUT"
  1182. echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH"
  1183. else
  1184. echo "run_detection=false" >> "$GITHUB_OUTPUT"
  1185. echo "Detection skipped: no agent outputs or patches to analyze"
  1186. fi
  1187. - name: Clear MCP Config for detection
  1188. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1189. run: |
  1190. rm -f "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json"
  1191. rm -f /home/runner/.copilot/mcp-config.json
  1192. rm -f "$GITHUB_WORKSPACE/.gemini/settings.json"
  1193. - name: Prepare threat detection files
  1194. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1195. run: |
  1196. mkdir -p /tmp/gh-aw/threat-detection/aw-prompts
  1197. cp /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt 2>/dev/null || true
  1198. if [ ! -s /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt ]; then
  1199. echo "::warning::ERR_VALIDATION: Missing or empty detection context prompt at /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt. Ensure the agent artifact includes /tmp/gh-aw/aw-prompts/prompt.txt. Detection will continue with fallback workflow context."
  1200. fi
  1201. cp /tmp/gh-aw/agent_output.json /tmp/gh-aw/threat-detection/agent_output.json 2>/dev/null || true
  1202. for f in /tmp/gh-aw/aw-*.patch; do
  1203. [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1204. done
  1205. for f in /tmp/gh-aw/aw-*.bundle; do
  1206. [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1207. done
  1208. echo "Prepared threat detection files:"
  1209. ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1210. - name: Setup threat detection
  1211. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1212. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1213. env:
  1214. WORKFLOW_NAME: "PR Review Intent"
  1215. WORKFLOW_DESCRIPTION: "自动审计 Pull Request 的代码意图、隐含约束、实现对齐情况与发布风险"
  1216. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  1217. with:
  1218. script: |
  1219. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1220. setupGlobals(core, github, context, exec, io, getOctokit);
  1221. const { main } = require('${{ runner.temp }}/gh-aw/actions/setup_threat_detection.cjs');
  1222. await main();
  1223. - name: Ensure threat-detection directory and log
  1224. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1225. run: |
  1226. mkdir -p /tmp/gh-aw/threat-detection
  1227. touch /tmp/gh-aw/threat-detection/detection.log
  1228. - name: Setup Node.js
  1229. uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
  1230. with:
  1231. node-version: '24'
  1232. package-manager-cache: false
  1233. - name: Install Codex CLI
  1234. run: npm install --ignore-scripts -g @openai/codex@0.135.0
  1235. - name: Install AWF binary
  1236. run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.58
  1237. - name: Download container images
  1238. run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.58 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.58 ghcr.io/github/gh-aw-firewall/squid:0.25.58 ghcr.io/github/gh-aw-mcpg:v0.3.22
  1239. - name: Start MCP Gateway
  1240. id: start-mcp-gateway
  1241. env:
  1242. CODEX_HOME: /tmp/gh-aw/mcp-config
  1243. run: |
  1244. set -eo pipefail
  1245. mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config"
  1246. # Export gateway environment variables for MCP config and gateway script
  1247. export MCP_GATEWAY_PORT="8080"
  1248. export MCP_GATEWAY_DOMAIN="host.docker.internal"
  1249. export MCP_GATEWAY_HOST_DOMAIN="localhost"
  1250. MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
  1251. echo "::add-mask::${MCP_GATEWAY_API_KEY}"
  1252. export MCP_GATEWAY_API_KEY
  1253. export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
  1254. mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
  1255. export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
  1256. export DEBUG="*"
  1257. export GH_AW_ENGINE="codex"
  1258. MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')
  1259. MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')
  1260. case "${DOCKER_HOST:-}" in
  1261. unix://* ) DOCKER_SOCK_PATH="${DOCKER_HOST#unix://}" ;;
  1262. /* ) DOCKER_SOCK_PATH="$DOCKER_HOST" ;;
  1263. * ) DOCKER_SOCK_PATH=/var/run/docker.sock ;;
  1264. esac
  1265. DOCKER_SOCK_GID=$(stat -c '%g' "$DOCKER_SOCK_PATH" 2>/dev/null || echo '0')
  1266. export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e CODEX_HOME -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.22'
  1267. cat > "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" << GH_AW_MCP_CONFIG_1a3604f199a55b84_EOF
  1268. [history]
  1269. persistence = "none"
  1270. [shell_environment_policy]
  1271. inherit = "core"
  1272. include_only = ["^CODEX_API_KEY$", "^HOME$", "^OPENAI_API_KEY$", "^PATH$"]
  1273. GH_AW_MCP_CONFIG_1a3604f199a55b84_EOF
  1274. # Generate JSON config for MCP gateway
  1275. GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
  1276. cat << GH_AW_MCP_CONFIG_e2ef1a75b2834923_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
  1277. {
  1278. "mcpServers": {
  1279. },
  1280. "gateway": {
  1281. "port": $MCP_GATEWAY_PORT,
  1282. "domain": "${MCP_GATEWAY_DOMAIN}",
  1283. "apiKey": "${MCP_GATEWAY_API_KEY}",
  1284. "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
  1285. }
  1286. }
  1287. GH_AW_MCP_CONFIG_e2ef1a75b2834923_EOF
  1288. # Sync converter output to writable CODEX_HOME for Codex
  1289. mkdir -p /tmp/gh-aw/mcp-config
  1290. cat > "/tmp/gh-aw/mcp-config/config.toml" << GH_AW_CODEX_SHELL_POLICY_6cfeee82402a35ba_EOF
  1291. model_provider = "openai-proxy"
  1292. [model_providers.openai-proxy]
  1293. name = "OpenAI AWF proxy"
  1294. base_url = "http://172.30.0.30:10000"
  1295. env_key = "OPENAI_API_KEY"
  1296. supports_websockets = false
  1297. [shell_environment_policy]
  1298. inherit = "core"
  1299. include_only = ["^CODEX_API_KEY$", "^HOME$", "^OPENAI_API_KEY$", "^PATH$"]
  1300. GH_AW_CODEX_SHELL_POLICY_6cfeee82402a35ba_EOF
  1301. awk '
  1302. BEGIN { skip_openai_proxy = 0 }
  1303. /^[[:space:]]*model_provider[[:space:]]*=/ { next }
  1304. /^\[model_providers\.openai-proxy\][[:space:]]*$/ { skip_openai_proxy = 1; next }
  1305. /^\[/ { skip_openai_proxy = 0 }
  1306. !skip_openai_proxy { print }
  1307. ' "${RUNNER_TEMP}/gh-aw/mcp-config/config.toml" >> "/tmp/gh-aw/mcp-config/config.toml"
  1308. chmod 600 "/tmp/gh-aw/mcp-config/config.toml"
  1309. mkdir -p "${CODEX_HOME}"
  1310. 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
  1311. chmod 600 "${CODEX_HOME}/config.toml"
  1312. - name: Execute Codex CLI
  1313. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1314. continue-on-error: true
  1315. id: detection_agentic_execution
  1316. run: |
  1317. set -o pipefail
  1318. printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
  1319. mkdir -p "$CODEX_HOME/logs" && touch /tmp/gh-aw/agent-step-summary.md && mkdir -p /tmp/gh-aw/threat-detection && printf '%s' '{"type":"object","properties":{"prompt_injection":{"type":"boolean"},"secret_leak":{"type":"boolean"},"malicious_patch":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["prompt_injection","secret_leak","malicious_patch","reasons"],"additionalProperties":false}' > /tmp/gh-aw/threat-detection/detection_schema.json
  1320. (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log)
  1321. printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.58/awf-config.schema.json","network":{"allowDomains":["172.30.0.1","api.openai.com","chatgpt.com","host.docker.internal","openai.com"]},"apiProxy":{"enabled":true,"enableTokenSteering":true,"maxRuns":500,"maxEffectiveTokens":25000000,"targets":{"openai":{"host":"ai-pixel.online"}}},"container":{"imageTag":"0.25.58"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json"
  1322. GH_AW_MODEL_MULTIPLIERS_PATH="/tmp/gh-aw/model_multipliers.json" node "${RUNNER_TEMP}/gh-aw/actions/merge_awf_model_multipliers.cjs"
  1323. cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
  1324. GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS=""
  1325. if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then
  1326. GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS="--docker-host-path-prefix /tmp/gh-aw"
  1327. fi
  1328. GH_AW_TOOL_CACHE_MOUNT=""
  1329. GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"
  1330. if [ -d "$GH_AW_TOOL_CACHE" ]; then
  1331. if [[ "$GH_AW_TOOL_CACHE" != /opt/* ]]; then
  1332. GH_AW_TOOL_CACHE_MOUNT="$GH_AW_TOOL_CACHE:$GH_AW_TOOL_CACHE:ro"
  1333. fi
  1334. elif [ -d "/home/runner/work/_tool" ]; then
  1335. GH_AW_TOOL_CACHE_MOUNT="/home/runner/work/_tool:/home/runner/work/_tool:ro"
  1336. fi
  1337. # shellcheck disable=SC1003
  1338. sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" ${GH_AW_TOOL_CACHE_MOUNT:+--mount "$GH_AW_TOOL_CACHE_MOUNT"} ${GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS} --env-all --exclude-env CODEX_API_KEY --exclude-env OPENAI_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \
  1339. -- /bin/bash -c 'set +o histexpand; GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"; export PATH="$(find "$GH_AW_TOOL_CACHE" /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/codex_harness.cjs codex exec${GH_AW_MODEL_DETECTION_CODEX:+ --model "$GH_AW_MODEL_DETECTION_CODEX"} -c web_search="disabled" -c fetch="disabled" --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --output-schema /tmp/gh-aw/threat-detection/detection_schema.json -o /tmp/gh-aw/threat-detection/detection_result.json --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log
  1340. env:
  1341. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
  1342. CODEX_HOME: /tmp/gh-aw/mcp-config
  1343. GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/config.toml
  1344. GH_AW_MODEL_DETECTION_CODEX: gpt-5.4
  1345. GH_AW_PHASE: detection
  1346. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  1347. GH_AW_VERSION: v0.77.5
  1348. GITHUB_AW: true
  1349. GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
  1350. GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
  1351. GIT_AUTHOR_NAME: github-actions[bot]
  1352. GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
  1353. GIT_COMMITTER_NAME: github-actions[bot]
  1354. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1355. OPENAI_BASE_URL: https://ai-pixel.online
  1356. RUNNER_TEMP: ${{ runner.temp }}
  1357. RUST_LOG: ${{ runner.debug == 1 && 'trace,hyper_util=info,mio=info,reqwest=info,os_info=info,codex_otel=warn,codex_core=debug,ocodex_exec=debug' || 'warn' }}
  1358. - name: Upload threat detection log
  1359. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1360. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  1361. with:
  1362. name: detection
  1363. path: /tmp/gh-aw/threat-detection/detection.log
  1364. if-no-files-found: ignore
  1365. - name: Parse and conclude threat detection
  1366. id: detection_conclusion
  1367. if: always()
  1368. continue-on-error: true
  1369. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1370. env:
  1371. RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
  1372. DETECTION_AGENTIC_EXECUTION_OUTCOME: ${{ steps.detection_agentic_execution.outcome }}
  1373. GH_AW_DETECTION_CONTINUE_ON_ERROR: "true"
  1374. with:
  1375. script: |
  1376. try {
  1377. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1378. setupGlobals(core, github, context, exec, io, getOctokit);
  1379. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs');
  1380. await main();
  1381. } catch (loadErr) {
  1382. const continueOnError = process.env.GH_AW_DETECTION_CONTINUE_ON_ERROR !== 'false';
  1383. const detectionExecutionFailed = process.env.DETECTION_AGENTIC_EXECUTION_OUTCOME === 'failure';
  1384. const msg = 'ERR_SYSTEM: \u274C Unexpected error loading threat detection module: ' + (loadErr && loadErr.message ? loadErr.message : String(loadErr));
  1385. core.error(msg);
  1386. core.setOutput('reason', 'parse_error');
  1387. if (continueOnError && !detectionExecutionFailed) {
  1388. core.warning('\u26A0\uFE0F ' + msg);
  1389. core.setOutput('conclusion', 'warning');
  1390. core.setOutput('success', 'false');
  1391. } else {
  1392. core.setOutput('conclusion', 'failure');
  1393. core.setOutput('success', 'false');
  1394. core.setFailed(msg);
  1395. }
  1396. }
  1397. safe_outputs:
  1398. needs:
  1399. - activation
  1400. - agent
  1401. - detection
  1402. if: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success'
  1403. runs-on: ubuntu-slim
  1404. permissions:
  1405. contents: read
  1406. discussions: write
  1407. issues: write
  1408. pull-requests: write
  1409. timeout-minutes: 15
  1410. env:
  1411. GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/pr-review-intent"
  1412. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  1413. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  1414. GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }}
  1415. GH_AW_ENGINE_ID: "codex"
  1416. GH_AW_ENGINE_MODEL: "gpt-5.4"
  1417. GH_AW_WORKFLOW_ID: "pr-review-intent"
  1418. GH_AW_WORKFLOW_NAME: "PR Review Intent"
  1419. GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/pr-review-intent.md"
  1420. outputs:
  1421. code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }}
  1422. code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }}
  1423. comment_id: ${{ steps.process_safe_outputs.outputs.comment_id }}
  1424. comment_url: ${{ steps.process_safe_outputs.outputs.comment_url }}
  1425. create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}
  1426. create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}
  1427. process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
  1428. process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
  1429. steps:
  1430. - name: Setup Scripts
  1431. id: setup
  1432. uses: github/gh-aw-actions/setup@3ea13c02d765410340d533515cb31a7eef2baaf0 # v0.77.5
  1433. with:
  1434. destination: ${{ runner.temp }}/gh-aw/actions
  1435. job-name: ${{ github.job }}
  1436. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1437. parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }}
  1438. env:
  1439. GH_AW_SETUP_WORKFLOW_NAME: "PR Review Intent"
  1440. GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/pr-review-intent.lock.yml@${{ github.ref }}
  1441. GH_AW_INFO_VERSION: "0.135.0"
  1442. GH_AW_INFO_AWF_VERSION: "v0.25.58"
  1443. GH_AW_INFO_ENGINE_ID: "codex"
  1444. - name: Download agent output artifact
  1445. id: download-agent-output
  1446. continue-on-error: true
  1447. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  1448. with:
  1449. name: agent
  1450. path: /tmp/gh-aw/
  1451. - name: Setup agent output environment variable
  1452. id: setup-agent-output-env
  1453. if: steps.download-agent-output.outcome == 'success'
  1454. run: |
  1455. mkdir -p /tmp/gh-aw/
  1456. find "/tmp/gh-aw/" -type f -print
  1457. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1458. - name: Configure GH_HOST for enterprise compatibility
  1459. id: ghes-host-config
  1460. shell: bash
  1461. run: |
  1462. # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct
  1463. # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op.
  1464. GH_HOST="${GITHUB_SERVER_URL#https://}"
  1465. GH_HOST="${GH_HOST#http://}"
  1466. echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV"
  1467. - name: Process Safe Outputs
  1468. id: process_safe_outputs
  1469. uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
  1470. env:
  1471. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1472. GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
  1473. GH_AW_ALLOWED_DOMAINS: "172.30.0.1,ai-pixel.online,api-inference.modelscope.cn,api.commandcode.ai,api.deepseek.com,api.minimaxi.com,api.openai.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,chatgpt.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,open.bigmodel.cn,openai.com,opencode.ai,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,s.symcb.com,s.symcd.com,security.ubuntu.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com"
  1474. GITHUB_SERVER_URL: ${{ github.server_url }}
  1475. GITHUB_API_URL: ${{ github.api_url }}
  1476. GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1,\"target\":\"triggering\"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}"
  1477. with:
  1478. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1479. script: |
  1480. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1481. setupGlobals(core, github, context, exec, io, getOctokit);
  1482. const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs');
  1483. await main();
  1484. - name: Upload Safe Outputs Items
  1485. if: always()
  1486. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  1487. with:
  1488. name: safe-outputs-items
  1489. path: |
  1490. /tmp/gh-aw/safe-output-items.jsonl
  1491. /tmp/gh-aw/temporary-id-map.json
  1492. if-no-files-found: ignore