weekly-report.lock.yml 66 KB

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