weekly-report.lock.yml 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205
  1. # gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"d5e049f0e9059d227cd2cd109564c000330332ca3e8d1748db87432bfd43451c","compiler_version":"v0.68.3","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":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/setup-node","sha":"53b83947a5a98c8d113130e565377fae1a50d02f","version":"v6.3.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"ba90f2186d7ad780ec640f364005fa24e797b360","version":"v0.68.3"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.20"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.20"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.20"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.2.19"},{"image":"ghcr.io/github/github-mcp-server:v0.32.0"},{"image":"node:lts-alpine"}]}
  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.68.3). 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. # 每周自动生成仓库活动报告,包括 PR/Issue 列表、Changelog、贡献者统计等
  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@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  44. # - actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
  45. # - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  46. # - github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
  47. #
  48. # Container images used:
  49. # - ghcr.io/github/gh-aw-firewall/agent:0.25.20
  50. # - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.20
  51. # - ghcr.io/github/gh-aw-firewall/squid:0.25.20
  52. # - ghcr.io/github/gh-aw-mcpg:v0.2.19
  53. # - ghcr.io/github/github-mcp-server:v0.32.0
  54. # - node:lts-alpine
  55. name: "Weekly Report"
  56. "on":
  57. schedule:
  58. - cron: "0 17 * * 4"
  59. workflow_dispatch:
  60. inputs:
  61. aw_context:
  62. default: ""
  63. description: Agent caller context (used internally by Agentic Workflows).
  64. required: false
  65. type: string
  66. permissions: {}
  67. concurrency:
  68. group: "gh-aw-${{ github.workflow }}"
  69. run-name: "Weekly Report"
  70. jobs:
  71. activation:
  72. runs-on: ubuntu-slim
  73. permissions:
  74. actions: read
  75. contents: read
  76. outputs:
  77. comment_id: ""
  78. comment_repo: ""
  79. lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }}
  80. model: ${{ steps.generate_aw_info.outputs.model }}
  81. secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }}
  82. setup-trace-id: ${{ steps.setup.outputs.trace-id }}
  83. stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }}
  84. steps:
  85. - name: Setup Scripts
  86. id: setup
  87. uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
  88. with:
  89. destination: ${{ runner.temp }}/gh-aw/actions
  90. job-name: ${{ github.job }}
  91. - name: Generate agentic run info
  92. id: generate_aw_info
  93. env:
  94. GH_AW_INFO_ENGINE_ID: "codex"
  95. GH_AW_INFO_ENGINE_NAME: "Codex"
  96. GH_AW_INFO_MODEL: "gpt-5.4"
  97. GH_AW_INFO_VERSION: "0.118.0"
  98. GH_AW_INFO_AGENT_VERSION: "0.118.0"
  99. GH_AW_INFO_CLI_VERSION: "v0.68.3"
  100. GH_AW_INFO_WORKFLOW_NAME: "Weekly Report"
  101. GH_AW_INFO_EXPERIMENTAL: "false"
  102. GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true"
  103. GH_AW_INFO_STAGED: "false"
  104. 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"]'
  105. GH_AW_INFO_FIREWALL_ENABLED: "true"
  106. GH_AW_INFO_AWF_VERSION: "v0.25.20"
  107. GH_AW_INFO_AWMG_VERSION: ""
  108. GH_AW_INFO_FIREWALL_TYPE: "squid"
  109. GH_AW_COMPILED_STRICT: "true"
  110. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  111. with:
  112. script: |
  113. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  114. setupGlobals(core, github, context, exec, io, getOctokit);
  115. const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_aw_info.cjs');
  116. await main(core, context);
  117. - name: Validate CODEX_API_KEY or OPENAI_API_KEY secret
  118. id: validate-secret
  119. 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
  120. env:
  121. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  122. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  123. - name: Checkout .github and .agents folders
  124. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  125. with:
  126. persist-credentials: false
  127. sparse-checkout: |
  128. .github
  129. .agents
  130. sparse-checkout-cone-mode: true
  131. fetch-depth: 1
  132. - name: Check workflow lock file
  133. id: check-lock-file
  134. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  135. env:
  136. GH_AW_WORKFLOW_FILE: "weekly-report.lock.yml"
  137. GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}"
  138. with:
  139. script: |
  140. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  141. setupGlobals(core, github, context, exec, io, getOctokit);
  142. const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs');
  143. await main();
  144. - name: Check compile-agentic version
  145. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  146. env:
  147. GH_AW_COMPILED_VERSION: "v0.68.3"
  148. with:
  149. script: |
  150. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  151. setupGlobals(core, github, context, exec, io, getOctokit);
  152. const { main } = require('${{ runner.temp }}/gh-aw/actions/check_version_updates.cjs');
  153. await main();
  154. - name: Create prompt with built-in context
  155. env:
  156. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  157. GH_AW_SAFE_OUTPUTS: ${{ runner.temp }}/gh-aw/safeoutputs/outputs.jsonl
  158. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  159. GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
  160. GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
  161. GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
  162. GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
  163. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  164. GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
  165. GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
  166. # poutine:ignore untrusted_checkout_exec
  167. run: |
  168. bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh"
  169. {
  170. cat << 'GH_AW_PROMPT_abb639e11ed360dd_EOF'
  171. <system>
  172. GH_AW_PROMPT_abb639e11ed360dd_EOF
  173. cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md"
  174. cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md"
  175. cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md"
  176. cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md"
  177. cat << 'GH_AW_PROMPT_abb639e11ed360dd_EOF'
  178. <safe-output-tools>
  179. Tools: create_issue, missing_tool, missing_data, noop
  180. </safe-output-tools>
  181. <github-context>
  182. The following GitHub context information is available for this workflow:
  183. {{#if __GH_AW_GITHUB_ACTOR__ }}
  184. - **actor**: __GH_AW_GITHUB_ACTOR__
  185. {{/if}}
  186. {{#if __GH_AW_GITHUB_REPOSITORY__ }}
  187. - **repository**: __GH_AW_GITHUB_REPOSITORY__
  188. {{/if}}
  189. {{#if __GH_AW_GITHUB_WORKSPACE__ }}
  190. - **workspace**: __GH_AW_GITHUB_WORKSPACE__
  191. {{/if}}
  192. {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }}
  193. - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__
  194. {{/if}}
  195. {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }}
  196. - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__
  197. {{/if}}
  198. {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }}
  199. - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__
  200. {{/if}}
  201. {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }}
  202. - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__
  203. {{/if}}
  204. {{#if __GH_AW_GITHUB_RUN_ID__ }}
  205. - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__
  206. {{/if}}
  207. </github-context>
  208. GH_AW_PROMPT_abb639e11ed360dd_EOF
  209. cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md"
  210. cat << 'GH_AW_PROMPT_abb639e11ed360dd_EOF'
  211. </system>
  212. {{#runtime-import .github/workflows/shared/engine.md}}
  213. {{#runtime-import .github/workflows/shared/network.md}}
  214. {{#runtime-import .github/workflows/weekly-report.md}}
  215. GH_AW_PROMPT_abb639e11ed360dd_EOF
  216. } > "$GH_AW_PROMPT"
  217. - name: Interpolate variables and render templates
  218. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  219. env:
  220. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  221. with:
  222. script: |
  223. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  224. setupGlobals(core, github, context, exec, io, getOctokit);
  225. const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs');
  226. await main();
  227. - name: Substitute placeholders
  228. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  229. env:
  230. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  231. GH_AW_GITHUB_ACTOR: ${{ github.actor }}
  232. GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
  233. GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
  234. GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
  235. GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
  236. GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  237. GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
  238. GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
  239. with:
  240. script: |
  241. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  242. setupGlobals(core, github, context, exec, io, getOctokit);
  243. const substitutePlaceholders = require('${{ runner.temp }}/gh-aw/actions/substitute_placeholders.cjs');
  244. // Call the substitution function
  245. return await substitutePlaceholders({
  246. file: process.env.GH_AW_PROMPT,
  247. substitutions: {
  248. GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR,
  249. GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID,
  250. GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER,
  251. GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER,
  252. GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER,
  253. GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY,
  254. GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID,
  255. GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE
  256. }
  257. });
  258. - name: Validate prompt placeholders
  259. env:
  260. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  261. # poutine:ignore untrusted_checkout_exec
  262. run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh"
  263. - name: Print prompt
  264. env:
  265. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  266. # poutine:ignore untrusted_checkout_exec
  267. run: bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh"
  268. - name: Upload activation artifact
  269. if: success()
  270. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  271. with:
  272. name: activation
  273. path: |
  274. /tmp/gh-aw/aw_info.json
  275. /tmp/gh-aw/aw-prompts/prompt.txt
  276. /tmp/gh-aw/github_rate_limits.jsonl
  277. if-no-files-found: ignore
  278. retention-days: 1
  279. agent:
  280. needs: activation
  281. runs-on: ubuntu-latest
  282. permissions:
  283. contents: read
  284. discussions: read
  285. issues: read
  286. pull-requests: read
  287. concurrency:
  288. group: "gh-aw-codex-${{ github.workflow }}"
  289. env:
  290. DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
  291. GH_AW_ASSETS_ALLOWED_EXTS: ""
  292. GH_AW_ASSETS_BRANCH: ""
  293. GH_AW_ASSETS_MAX_SIZE_KB: 0
  294. GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
  295. GH_AW_WORKFLOW_ID_SANITIZED: weeklyreport
  296. outputs:
  297. checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }}
  298. effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }}
  299. has_patch: ${{ steps.collect_output.outputs.has_patch }}
  300. model: ${{ needs.activation.outputs.model }}
  301. output: ${{ steps.collect_output.outputs.output }}
  302. output_types: ${{ steps.collect_output.outputs.output_types }}
  303. setup-trace-id: ${{ steps.setup.outputs.trace-id }}
  304. steps:
  305. - name: Setup Scripts
  306. id: setup
  307. uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
  308. with:
  309. destination: ${{ runner.temp }}/gh-aw/actions
  310. job-name: ${{ github.job }}
  311. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  312. - name: Set runtime paths
  313. id: set-runtime-paths
  314. run: |
  315. {
  316. echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl"
  317. echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json"
  318. echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json"
  319. } >> "$GITHUB_OUTPUT"
  320. - name: Checkout repository
  321. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  322. with:
  323. persist-credentials: false
  324. - name: Create gh-aw temp directory
  325. run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh"
  326. - name: Configure gh CLI for GitHub Enterprise
  327. run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh"
  328. env:
  329. GH_TOKEN: ${{ github.token }}
  330. - name: Configure Git credentials
  331. env:
  332. REPO_NAME: ${{ github.repository }}
  333. SERVER_URL: ${{ github.server_url }}
  334. GITHUB_TOKEN: ${{ github.token }}
  335. run: |
  336. git config --global user.email "github-actions[bot]@users.noreply.github.com"
  337. git config --global user.name "github-actions[bot]"
  338. git config --global am.keepcr true
  339. # Re-authenticate git with GitHub token
  340. SERVER_URL_STRIPPED="${SERVER_URL#https://}"
  341. git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
  342. echo "Git configured with standard GitHub Actions identity"
  343. - name: Checkout PR branch
  344. id: checkout-pr
  345. if: |
  346. github.event.pull_request || github.event.issue.pull_request
  347. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  348. env:
  349. GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  350. with:
  351. github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  352. script: |
  353. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  354. setupGlobals(core, github, context, exec, io, getOctokit);
  355. const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs');
  356. await main();
  357. - name: Setup Node.js
  358. uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
  359. with:
  360. node-version: '24'
  361. package-manager-cache: false
  362. - name: Install Codex CLI
  363. run: npm install --ignore-scripts -g @openai/codex@0.118.0
  364. - name: Install AWF binary
  365. run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.20
  366. - name: Parse integrity filter lists
  367. id: parse-guard-vars
  368. env:
  369. GH_AW_BLOCKED_USERS_VAR: ${{ vars.GH_AW_GITHUB_BLOCKED_USERS || '' }}
  370. GH_AW_TRUSTED_USERS_VAR: ${{ vars.GH_AW_GITHUB_TRUSTED_USERS || '' }}
  371. GH_AW_APPROVAL_LABELS_VAR: ${{ vars.GH_AW_GITHUB_APPROVAL_LABELS || '' }}
  372. run: bash "${RUNNER_TEMP}/gh-aw/actions/parse_guard_list.sh"
  373. - name: Download container images
  374. run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.20 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.20 ghcr.io/github/gh-aw-firewall/squid:0.25.20 ghcr.io/github/gh-aw-mcpg:v0.2.19 ghcr.io/github/github-mcp-server:v0.32.0 node:lts-alpine
  375. - name: Write Safe Outputs Config
  376. run: |
  377. mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"
  378. mkdir -p /tmp/gh-aw/safeoutputs
  379. mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
  380. cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_f707cd406f1f2c29_EOF'
  381. {"create_issue":{"close_older_issues":true,"expires":720,"labels":["weekly-report","report"],"max":1,"title_prefix":"Weekly Report: "},"create_report_incomplete_issue":{},"max_bot_mentions":1,"mentions":{"enabled":false},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}}
  382. GH_AW_SAFE_OUTPUTS_CONFIG_f707cd406f1f2c29_EOF
  383. - name: Write Safe Outputs Tools
  384. env:
  385. GH_AW_TOOLS_META_JSON: |
  386. {
  387. "description_suffixes": {
  388. "create_issue": " CONSTRAINTS: Maximum 1 issue(s) can be created. Title will be prefixed with \"Weekly Report: \". Labels [\"weekly-report\" \"report\"] will be automatically added."
  389. },
  390. "repo_params": {},
  391. "dynamic_tools": []
  392. }
  393. GH_AW_VALIDATION_JSON: |
  394. {
  395. "create_issue": {
  396. "defaultMax": 1,
  397. "fields": {
  398. "body": {
  399. "required": true,
  400. "type": "string",
  401. "sanitize": true,
  402. "maxLength": 65000
  403. },
  404. "labels": {
  405. "type": "array",
  406. "itemType": "string",
  407. "itemSanitize": true,
  408. "itemMaxLength": 128
  409. },
  410. "parent": {
  411. "issueOrPRNumber": true
  412. },
  413. "repo": {
  414. "type": "string",
  415. "maxLength": 256
  416. },
  417. "temporary_id": {
  418. "type": "string"
  419. },
  420. "title": {
  421. "required": true,
  422. "type": "string",
  423. "sanitize": true,
  424. "maxLength": 128
  425. }
  426. }
  427. },
  428. "missing_data": {
  429. "defaultMax": 20,
  430. "fields": {
  431. "alternatives": {
  432. "type": "string",
  433. "sanitize": true,
  434. "maxLength": 256
  435. },
  436. "context": {
  437. "type": "string",
  438. "sanitize": true,
  439. "maxLength": 256
  440. },
  441. "data_type": {
  442. "type": "string",
  443. "sanitize": true,
  444. "maxLength": 128
  445. },
  446. "reason": {
  447. "type": "string",
  448. "sanitize": true,
  449. "maxLength": 256
  450. }
  451. }
  452. },
  453. "missing_tool": {
  454. "defaultMax": 20,
  455. "fields": {
  456. "alternatives": {
  457. "type": "string",
  458. "sanitize": true,
  459. "maxLength": 512
  460. },
  461. "reason": {
  462. "required": true,
  463. "type": "string",
  464. "sanitize": true,
  465. "maxLength": 256
  466. },
  467. "tool": {
  468. "type": "string",
  469. "sanitize": true,
  470. "maxLength": 128
  471. }
  472. }
  473. },
  474. "noop": {
  475. "defaultMax": 1,
  476. "fields": {
  477. "message": {
  478. "required": true,
  479. "type": "string",
  480. "sanitize": true,
  481. "maxLength": 65000
  482. }
  483. }
  484. },
  485. "report_incomplete": {
  486. "defaultMax": 5,
  487. "fields": {
  488. "details": {
  489. "type": "string",
  490. "sanitize": true,
  491. "maxLength": 65000
  492. },
  493. "reason": {
  494. "required": true,
  495. "type": "string",
  496. "sanitize": true,
  497. "maxLength": 1024
  498. }
  499. }
  500. }
  501. }
  502. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  503. with:
  504. script: |
  505. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  506. setupGlobals(core, github, context, exec, io, getOctokit);
  507. const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_safe_outputs_tools.cjs');
  508. await main();
  509. - name: Generate Safe Outputs MCP Server Config
  510. id: safe-outputs-config
  511. run: |
  512. # Generate a secure random API key (360 bits of entropy, 40+ chars)
  513. # Mask immediately to prevent timing vulnerabilities
  514. API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
  515. echo "::add-mask::${API_KEY}"
  516. PORT=3001
  517. # Set outputs for next steps
  518. {
  519. echo "safe_outputs_api_key=${API_KEY}"
  520. echo "safe_outputs_port=${PORT}"
  521. } >> "$GITHUB_OUTPUT"
  522. echo "Safe Outputs MCP server will run on port ${PORT}"
  523. - name: Start Safe Outputs MCP HTTP Server
  524. id: safe-outputs-start
  525. env:
  526. DEBUG: '*'
  527. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  528. GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }}
  529. GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }}
  530. GH_AW_SAFE_OUTPUTS_TOOLS_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/tools.json
  531. GH_AW_SAFE_OUTPUTS_CONFIG_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/config.json
  532. GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
  533. run: |
  534. # Environment variables are set above to prevent template injection
  535. export DEBUG
  536. export GH_AW_SAFE_OUTPUTS
  537. export GH_AW_SAFE_OUTPUTS_PORT
  538. export GH_AW_SAFE_OUTPUTS_API_KEY
  539. export GH_AW_SAFE_OUTPUTS_TOOLS_PATH
  540. export GH_AW_SAFE_OUTPUTS_CONFIG_PATH
  541. export GH_AW_MCP_LOG_DIR
  542. bash "${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh"
  543. - name: Start MCP Gateway
  544. id: start-mcp-gateway
  545. env:
  546. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  547. GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }}
  548. GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }}
  549. GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  550. run: |
  551. set -eo pipefail
  552. mkdir -p /tmp/gh-aw/mcp-config
  553. # Export gateway environment variables for MCP config and gateway script
  554. export MCP_GATEWAY_PORT="80"
  555. export MCP_GATEWAY_DOMAIN="host.docker.internal"
  556. MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
  557. echo "::add-mask::${MCP_GATEWAY_API_KEY}"
  558. export MCP_GATEWAY_API_KEY
  559. export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
  560. mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
  561. export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
  562. export DEBUG="*"
  563. export GH_AW_ENGINE="codex"
  564. export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/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 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 -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.2.19'
  565. cat > /tmp/gh-aw/mcp-config/config.toml << GH_AW_MCP_CONFIG_0ea6235960c71f1a_EOF
  566. [history]
  567. persistence = "none"
  568. [shell_environment_policy]
  569. inherit = "core"
  570. 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"]
  571. [mcp_servers.github]
  572. user_agent = "weekly-report"
  573. startup_timeout_sec = 120
  574. tool_timeout_sec = 60
  575. container = "ghcr.io/github/github-mcp-server:v0.32.0"
  576. 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" }
  577. env_vars = ["GITHUB_HOST", "GITHUB_PERSONAL_ACCESS_TOKEN", "GITHUB_READ_ONLY", "GITHUB_TOOLSETS"]
  578. [mcp_servers.safeoutputs]
  579. type = "http"
  580. url = "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT"
  581. [mcp_servers.safeoutputs.headers]
  582. Authorization = "$GH_AW_SAFE_OUTPUTS_API_KEY"
  583. [mcp_servers.safeoutputs."guard-policies"]
  584. [mcp_servers.safeoutputs."guard-policies".write-sink]
  585. accept = ["*"]
  586. GH_AW_MCP_CONFIG_0ea6235960c71f1a_EOF
  587. # Generate JSON config for MCP gateway
  588. cat << GH_AW_MCP_CONFIG_0ea6235960c71f1a_EOF | bash "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh"
  589. {
  590. "mcpServers": {
  591. "github": {
  592. "container": "ghcr.io/github/github-mcp-server:v0.32.0",
  593. "env": {
  594. "GITHUB_HOST": "$GITHUB_SERVER_URL",
  595. "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_MCP_SERVER_TOKEN",
  596. "GITHUB_READ_ONLY": "1",
  597. "GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
  598. },
  599. "guard-policies": {
  600. "allow-only": {
  601. "approval-labels": ${{ steps.parse-guard-vars.outputs.approval_labels }},
  602. "blocked-users": ${{ steps.parse-guard-vars.outputs.blocked_users }},
  603. "min-integrity": "none",
  604. "repos": "all",
  605. "trusted-users": ${{ steps.parse-guard-vars.outputs.trusted_users }}
  606. }
  607. }
  608. },
  609. "safeoutputs": {
  610. "type": "http",
  611. "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT",
  612. "headers": {
  613. "Authorization": "$GH_AW_SAFE_OUTPUTS_API_KEY"
  614. },
  615. "guard-policies": {
  616. "write-sink": {
  617. "accept": [
  618. "*"
  619. ]
  620. }
  621. }
  622. }
  623. },
  624. "gateway": {
  625. "port": $MCP_GATEWAY_PORT,
  626. "domain": "${MCP_GATEWAY_DOMAIN}",
  627. "apiKey": "${MCP_GATEWAY_API_KEY}",
  628. "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
  629. }
  630. }
  631. GH_AW_MCP_CONFIG_0ea6235960c71f1a_EOF
  632. - name: Download activation artifact
  633. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  634. with:
  635. name: activation
  636. path: /tmp/gh-aw
  637. - name: Clean git credentials
  638. continue-on-error: true
  639. run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh"
  640. - name: Execute Codex CLI
  641. id: agentic_execution
  642. run: |
  643. set -o pipefail
  644. mkdir -p "$CODEX_HOME/logs" && touch /tmp/gh-aw/agent-step-summary.md
  645. (umask 177 && touch /tmp/gh-aw/agent-stdio.log)
  646. # shellcheck disable=SC1003
  647. sudo -E awf --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" --env-all --exclude-env CODEX_API_KEY --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --exclude-env OPENAI_API_KEY --allow-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,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 --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.20 --skip-pull --enable-api-proxy --openai-api-target ai-pixel.online \
  648. -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && INSTRUCTION="$(cat /tmp/gh-aw/aw-prompts/prompt.txt)" && codex ${GH_AW_MODEL_AGENT_CODEX:+-c model="$GH_AW_MODEL_AGENT_CODEX" }exec -c web_search="disabled" -c fetch="disabled" --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check "$INSTRUCTION"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
  649. env:
  650. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
  651. CODEX_HOME: /tmp/gh-aw/mcp-config
  652. GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/config.toml
  653. GH_AW_MODEL_AGENT_CODEX: gpt-5.4
  654. GH_AW_PHASE: agent
  655. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  656. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  657. GH_AW_VERSION: v0.68.3
  658. GITHUB_AW: true
  659. GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
  660. GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
  661. GIT_AUTHOR_NAME: github-actions[bot]
  662. GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
  663. GIT_COMMITTER_NAME: github-actions[bot]
  664. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  665. OPENAI_BASE_URL: https://ai-pixel.online
  666. RUST_LOG: trace,hyper_util=info,mio=info,reqwest=info,os_info=info,codex_otel=warn,codex_core=debug,ocodex_exec=debug
  667. - name: Configure Git credentials
  668. env:
  669. REPO_NAME: ${{ github.repository }}
  670. SERVER_URL: ${{ github.server_url }}
  671. GITHUB_TOKEN: ${{ github.token }}
  672. run: |
  673. git config --global user.email "github-actions[bot]@users.noreply.github.com"
  674. git config --global user.name "github-actions[bot]"
  675. git config --global am.keepcr true
  676. # Re-authenticate git with GitHub token
  677. SERVER_URL_STRIPPED="${SERVER_URL#https://}"
  678. git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
  679. echo "Git configured with standard GitHub Actions identity"
  680. - name: Stop MCP Gateway
  681. if: always()
  682. continue-on-error: true
  683. env:
  684. MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
  685. MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
  686. GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }}
  687. run: |
  688. bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID"
  689. - name: Redact secrets in logs
  690. if: always()
  691. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  692. with:
  693. script: |
  694. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  695. setupGlobals(core, github, context, exec, io, getOctokit);
  696. const { main } = require('${{ runner.temp }}/gh-aw/actions/redact_secrets.cjs');
  697. await main();
  698. env:
  699. 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'
  700. SECRET_CODEX_API_KEY: ${{ secrets.CODEX_API_KEY }}
  701. SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
  702. SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
  703. SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  704. SECRET_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  705. SECRET_PIXEL_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  706. - name: Append agent step summary
  707. if: always()
  708. run: bash "${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh"
  709. - name: Copy Safe Outputs
  710. if: always()
  711. env:
  712. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  713. run: |
  714. mkdir -p /tmp/gh-aw
  715. cp "$GH_AW_SAFE_OUTPUTS" /tmp/gh-aw/safeoutputs.jsonl 2>/dev/null || true
  716. - name: Ingest agent output
  717. id: collect_output
  718. if: always()
  719. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  720. env:
  721. GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
  722. 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,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"
  723. GH_AW_ALLOWED_GITHUB_REFS: ""
  724. GITHUB_SERVER_URL: ${{ github.server_url }}
  725. GITHUB_API_URL: ${{ github.api_url }}
  726. with:
  727. script: |
  728. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  729. setupGlobals(core, github, context, exec, io, getOctokit);
  730. const { main } = require('${{ runner.temp }}/gh-aw/actions/collect_ndjson_output.cjs');
  731. await main();
  732. - name: Parse agent logs for step summary
  733. if: always()
  734. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  735. env:
  736. GH_AW_AGENT_OUTPUT: /tmp/gh-aw/agent-stdio.log
  737. with:
  738. script: |
  739. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  740. setupGlobals(core, github, context, exec, io, getOctokit);
  741. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_codex_log.cjs');
  742. await main();
  743. - name: Parse MCP Gateway logs for step summary
  744. if: always()
  745. id: parse-mcp-gateway
  746. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  747. with:
  748. script: |
  749. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  750. setupGlobals(core, github, context, exec, io, getOctokit);
  751. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_mcp_gateway_log.cjs');
  752. await main();
  753. - name: Print firewall logs
  754. if: always()
  755. continue-on-error: true
  756. env:
  757. AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
  758. run: |
  759. # Fix permissions on firewall logs so they can be uploaded as artifacts
  760. # AWF runs with sudo, creating files owned by root
  761. sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true
  762. # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step)
  763. if command -v awf &> /dev/null; then
  764. awf logs summary | tee -a "$GITHUB_STEP_SUMMARY"
  765. else
  766. echo 'AWF binary not installed, skipping firewall log summary'
  767. fi
  768. - name: Parse token usage for step summary
  769. if: always()
  770. continue-on-error: true
  771. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  772. with:
  773. script: |
  774. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  775. setupGlobals(core, github, context, exec, io, getOctokit);
  776. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs');
  777. await main();
  778. - name: Write agent output placeholder if missing
  779. if: always()
  780. run: |
  781. if [ ! -f /tmp/gh-aw/agent_output.json ]; then
  782. echo '{"items":[]}' > /tmp/gh-aw/agent_output.json
  783. fi
  784. - name: Upload agent artifacts
  785. if: always()
  786. continue-on-error: true
  787. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  788. with:
  789. name: agent
  790. path: |
  791. /tmp/gh-aw/aw-prompts/prompt.txt
  792. /tmp/gh-aw/mcp-config/logs/
  793. /tmp/gh-aw/redacted-urls.log
  794. /tmp/gh-aw/mcp-logs/
  795. /tmp/gh-aw/proxy-logs/
  796. !/tmp/gh-aw/proxy-logs/proxy-tls/
  797. /tmp/gh-aw/agent_usage.json
  798. /tmp/gh-aw/agent-stdio.log
  799. /tmp/gh-aw/agent/
  800. /tmp/gh-aw/github_rate_limits.jsonl
  801. /tmp/gh-aw/safeoutputs.jsonl
  802. /tmp/gh-aw/agent_output.json
  803. /tmp/gh-aw/aw-*.patch
  804. /tmp/gh-aw/aw-*.bundle
  805. /tmp/gh-aw/sandbox/firewall/logs/
  806. /tmp/gh-aw/sandbox/firewall/audit/
  807. if-no-files-found: ignore
  808. conclusion:
  809. needs:
  810. - activation
  811. - agent
  812. - detection
  813. - safe_outputs
  814. if: >
  815. always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' ||
  816. needs.activation.outputs.stale_lock_file_failed == 'true')
  817. runs-on: ubuntu-slim
  818. permissions:
  819. contents: read
  820. issues: write
  821. concurrency:
  822. group: "gh-aw-conclusion-weekly-report"
  823. cancel-in-progress: false
  824. outputs:
  825. incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }}
  826. noop_message: ${{ steps.noop.outputs.noop_message }}
  827. tools_reported: ${{ steps.missing_tool.outputs.tools_reported }}
  828. total_count: ${{ steps.missing_tool.outputs.total_count }}
  829. steps:
  830. - name: Setup Scripts
  831. id: setup
  832. uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
  833. with:
  834. destination: ${{ runner.temp }}/gh-aw/actions
  835. job-name: ${{ github.job }}
  836. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  837. - name: Download agent output artifact
  838. id: download-agent-output
  839. continue-on-error: true
  840. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  841. with:
  842. name: agent
  843. path: /tmp/gh-aw/
  844. - name: Setup agent output environment variable
  845. id: setup-agent-output-env
  846. if: steps.download-agent-output.outcome == 'success'
  847. run: |
  848. mkdir -p /tmp/gh-aw/
  849. find "/tmp/gh-aw/" -type f -print
  850. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  851. - name: Process no-op messages
  852. id: noop
  853. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  854. env:
  855. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  856. GH_AW_NOOP_MAX: "1"
  857. GH_AW_WORKFLOW_NAME: "Weekly Report"
  858. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  859. GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
  860. GH_AW_NOOP_REPORT_AS_ISSUE: "true"
  861. with:
  862. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  863. script: |
  864. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  865. setupGlobals(core, github, context, exec, io, getOctokit);
  866. const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs');
  867. await main();
  868. - name: Log detection run
  869. id: detection_runs
  870. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  871. env:
  872. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  873. GH_AW_WORKFLOW_NAME: "Weekly Report"
  874. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  875. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  876. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  877. with:
  878. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  879. script: |
  880. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  881. setupGlobals(core, github, context, exec, io, getOctokit);
  882. const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_detection_runs.cjs');
  883. await main();
  884. - name: Record missing tool
  885. id: missing_tool
  886. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  887. env:
  888. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  889. GH_AW_MISSING_TOOL_CREATE_ISSUE: "true"
  890. GH_AW_WORKFLOW_NAME: "Weekly Report"
  891. with:
  892. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  893. script: |
  894. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  895. setupGlobals(core, github, context, exec, io, getOctokit);
  896. const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs');
  897. await main();
  898. - name: Record incomplete
  899. id: report_incomplete
  900. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  901. env:
  902. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  903. GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true"
  904. GH_AW_WORKFLOW_NAME: "Weekly Report"
  905. with:
  906. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  907. script: |
  908. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  909. setupGlobals(core, github, context, exec, io, getOctokit);
  910. const { main } = require('${{ runner.temp }}/gh-aw/actions/report_incomplete_handler.cjs');
  911. await main();
  912. - name: Handle agent failure
  913. id: handle_agent_failure
  914. if: always()
  915. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  916. env:
  917. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  918. GH_AW_WORKFLOW_NAME: "Weekly Report"
  919. GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  920. GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
  921. GH_AW_WORKFLOW_ID: "weekly-report"
  922. GH_AW_ENGINE_ID: "codex"
  923. GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
  924. GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
  925. GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }}
  926. GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }}
  927. GH_AW_GROUP_REPORTS: "false"
  928. GH_AW_FAILURE_REPORT_AS_ISSUE: "true"
  929. GH_AW_TIMEOUT_MINUTES: "20"
  930. with:
  931. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  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/handle_agent_failure.cjs');
  936. await main();
  937. detection:
  938. needs:
  939. - activation
  940. - agent
  941. if: >
  942. always() && needs.agent.result != 'skipped' && (needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true')
  943. runs-on: ubuntu-latest
  944. permissions:
  945. contents: read
  946. outputs:
  947. detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }}
  948. detection_reason: ${{ steps.detection_conclusion.outputs.reason }}
  949. detection_success: ${{ steps.detection_conclusion.outputs.success }}
  950. steps:
  951. - name: Setup Scripts
  952. id: setup
  953. uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
  954. with:
  955. destination: ${{ runner.temp }}/gh-aw/actions
  956. job-name: ${{ github.job }}
  957. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  958. - name: Download agent output artifact
  959. id: download-agent-output
  960. continue-on-error: true
  961. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  962. with:
  963. name: agent
  964. path: /tmp/gh-aw/
  965. - name: Setup agent output environment variable
  966. id: setup-agent-output-env
  967. if: steps.download-agent-output.outcome == 'success'
  968. run: |
  969. mkdir -p /tmp/gh-aw/
  970. find "/tmp/gh-aw/" -type f -print
  971. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  972. - name: Checkout repository for patch context
  973. if: needs.agent.outputs.has_patch == 'true'
  974. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  975. with:
  976. persist-credentials: false
  977. # --- Threat Detection ---
  978. - name: Clean stale firewall files from agent artifact
  979. run: |
  980. rm -rf /tmp/gh-aw/sandbox/firewall/logs
  981. rm -rf /tmp/gh-aw/sandbox/firewall/audit
  982. - name: Download container images
  983. run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.20 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.20 ghcr.io/github/gh-aw-firewall/squid:0.25.20
  984. - name: Check if detection needed
  985. id: detection_guard
  986. if: always()
  987. env:
  988. OUTPUT_TYPES: ${{ needs.agent.outputs.output_types }}
  989. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  990. run: |
  991. if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then
  992. echo "run_detection=true" >> "$GITHUB_OUTPUT"
  993. echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH"
  994. else
  995. echo "run_detection=false" >> "$GITHUB_OUTPUT"
  996. echo "Detection skipped: no agent outputs or patches to analyze"
  997. fi
  998. - name: Clear MCP configuration for detection
  999. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1000. run: |
  1001. rm -f /tmp/gh-aw/mcp-config/mcp-servers.json
  1002. rm -f /home/runner/.copilot/mcp-config.json
  1003. rm -f "$GITHUB_WORKSPACE/.gemini/settings.json"
  1004. - name: Prepare threat detection files
  1005. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1006. run: |
  1007. mkdir -p /tmp/gh-aw/threat-detection/aw-prompts
  1008. cp /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt 2>/dev/null || true
  1009. cp /tmp/gh-aw/agent_output.json /tmp/gh-aw/threat-detection/agent_output.json 2>/dev/null || true
  1010. for f in /tmp/gh-aw/aw-*.patch; do
  1011. [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1012. done
  1013. for f in /tmp/gh-aw/aw-*.bundle; do
  1014. [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1015. done
  1016. echo "Prepared threat detection files:"
  1017. ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true
  1018. - name: Setup threat detection
  1019. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1020. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  1021. env:
  1022. WORKFLOW_NAME: "Weekly Report"
  1023. WORKFLOW_DESCRIPTION: "每周自动生成仓库活动报告,包括 PR/Issue 列表、Changelog、贡献者统计等"
  1024. HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
  1025. with:
  1026. script: |
  1027. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1028. setupGlobals(core, github, context, exec, io, getOctokit);
  1029. const { main } = require('${{ runner.temp }}/gh-aw/actions/setup_threat_detection.cjs');
  1030. await main();
  1031. - name: Ensure threat-detection directory and log
  1032. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1033. run: |
  1034. mkdir -p /tmp/gh-aw/threat-detection
  1035. touch /tmp/gh-aw/threat-detection/detection.log
  1036. - name: Setup Node.js
  1037. uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
  1038. with:
  1039. node-version: '24'
  1040. package-manager-cache: false
  1041. - name: Install Codex CLI
  1042. run: npm install --ignore-scripts -g @openai/codex@0.118.0
  1043. - name: Install AWF binary
  1044. run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.20
  1045. - name: Execute Codex CLI
  1046. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1047. id: detection_agentic_execution
  1048. run: |
  1049. set -o pipefail
  1050. mkdir -p "$CODEX_HOME/logs" && touch /tmp/gh-aw/agent-step-summary.md
  1051. (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log)
  1052. # shellcheck disable=SC1003
  1053. sudo -E awf --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" --env-all --exclude-env CODEX_API_KEY --exclude-env OPENAI_API_KEY --allow-domains 172.30.0.1,api.openai.com,host.docker.internal,openai.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.20 --skip-pull --enable-api-proxy --openai-api-target ai-pixel.online \
  1054. -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && INSTRUCTION="$(cat /tmp/gh-aw/aw-prompts/prompt.txt)" && codex ${GH_AW_MODEL_DETECTION_CODEX:+-c model="$GH_AW_MODEL_DETECTION_CODEX" }exec -c web_search="disabled" -c fetch="disabled" --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check "$INSTRUCTION"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log
  1055. env:
  1056. CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
  1057. CODEX_HOME: /tmp/gh-aw/mcp-config
  1058. GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/config.toml
  1059. GH_AW_MODEL_DETECTION_CODEX: gpt-5.4
  1060. GH_AW_PHASE: detection
  1061. GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
  1062. GH_AW_VERSION: v0.68.3
  1063. GITHUB_AW: true
  1064. GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
  1065. GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
  1066. GIT_AUTHOR_NAME: github-actions[bot]
  1067. GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
  1068. GIT_COMMITTER_NAME: github-actions[bot]
  1069. OPENAI_API_KEY: ${{ secrets.PIXEL_API_KEY }}
  1070. OPENAI_BASE_URL: https://ai-pixel.online
  1071. RUST_LOG: trace,hyper_util=info,mio=info,reqwest=info,os_info=info,codex_otel=warn,codex_core=debug,ocodex_exec=debug
  1072. - name: Upload threat detection log
  1073. if: always() && steps.detection_guard.outputs.run_detection == 'true'
  1074. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  1075. with:
  1076. name: detection
  1077. path: /tmp/gh-aw/threat-detection/detection.log
  1078. if-no-files-found: ignore
  1079. - name: Parse and conclude threat detection
  1080. id: detection_conclusion
  1081. if: always()
  1082. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  1083. env:
  1084. RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
  1085. GH_AW_DETECTION_CONTINUE_ON_ERROR: "true"
  1086. with:
  1087. script: |
  1088. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1089. setupGlobals(core, github, context, exec, io, getOctokit);
  1090. const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs');
  1091. await main();
  1092. safe_outputs:
  1093. needs:
  1094. - activation
  1095. - agent
  1096. - detection
  1097. if: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success'
  1098. runs-on: ubuntu-slim
  1099. permissions:
  1100. contents: read
  1101. issues: write
  1102. timeout-minutes: 15
  1103. env:
  1104. GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/weekly-report"
  1105. GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }}
  1106. GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }}
  1107. GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }}
  1108. GH_AW_ENGINE_ID: "codex"
  1109. GH_AW_ENGINE_MODEL: "gpt-5.4"
  1110. GH_AW_WORKFLOW_ID: "weekly-report"
  1111. GH_AW_WORKFLOW_NAME: "Weekly Report"
  1112. outputs:
  1113. code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }}
  1114. code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }}
  1115. create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}
  1116. create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}
  1117. created_issue_number: ${{ steps.process_safe_outputs.outputs.created_issue_number }}
  1118. created_issue_url: ${{ steps.process_safe_outputs.outputs.created_issue_url }}
  1119. process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
  1120. process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
  1121. steps:
  1122. - name: Setup Scripts
  1123. id: setup
  1124. uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
  1125. with:
  1126. destination: ${{ runner.temp }}/gh-aw/actions
  1127. job-name: ${{ github.job }}
  1128. trace-id: ${{ needs.activation.outputs.setup-trace-id }}
  1129. - name: Download agent output artifact
  1130. id: download-agent-output
  1131. continue-on-error: true
  1132. uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  1133. with:
  1134. name: agent
  1135. path: /tmp/gh-aw/
  1136. - name: Setup agent output environment variable
  1137. id: setup-agent-output-env
  1138. if: steps.download-agent-output.outcome == 'success'
  1139. run: |
  1140. mkdir -p /tmp/gh-aw/
  1141. find "/tmp/gh-aw/" -type f -print
  1142. echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
  1143. - name: Configure GH_HOST for enterprise compatibility
  1144. id: ghes-host-config
  1145. shell: bash
  1146. run: |
  1147. # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct
  1148. # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op.
  1149. GH_HOST="${GITHUB_SERVER_URL#https://}"
  1150. GH_HOST="${GH_HOST#http://}"
  1151. echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV"
  1152. - name: Process Safe Outputs
  1153. id: process_safe_outputs
  1154. uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
  1155. env:
  1156. GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
  1157. 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,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"
  1158. GITHUB_SERVER_URL: ${{ github.server_url }}
  1159. GITHUB_API_URL: ${{ github.api_url }}
  1160. GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"close_older_issues\":true,\"expires\":720,\"labels\":[\"weekly-report\",\"report\"],\"max\":1,\"title_prefix\":\"Weekly Report: \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}"
  1161. with:
  1162. github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
  1163. script: |
  1164. const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
  1165. setupGlobals(core, github, context, exec, io, getOctokit);
  1166. const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs');
  1167. await main();
  1168. - name: Upload Safe Outputs Items
  1169. if: always()
  1170. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  1171. with:
  1172. name: safe-outputs-items
  1173. path: |
  1174. /tmp/gh-aw/safe-output-items.jsonl
  1175. /tmp/gh-aw/temporary-id-map.json
  1176. if-no-files-found: ignore