memory-journal-mcp 6.1.2 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/README.md +44 -28
  2. package/dist/{chunk-X4SWFATC.js → chunk-BI4ZNSKA.js} +38 -24
  3. package/dist/{chunk-HCEWINSB.js → chunk-N6EBIDN7.js} +99 -102
  4. package/dist/cli.js +2 -2
  5. package/dist/index.js +2 -2
  6. package/dist/tools-WPRY5MJ6.js +2 -0
  7. package/package.json +10 -1
  8. package/skills/github-commander/SKILL.md +151 -0
  9. package/skills/github-commander/config/project-config.example.md +125 -0
  10. package/skills/github-commander/workflows/code-quality-audit.md +80 -0
  11. package/skills/github-commander/workflows/full-audit.md +134 -0
  12. package/skills/github-commander/workflows/issue-triage.md +239 -0
  13. package/skills/github-commander/workflows/milestone-sprint.md +81 -0
  14. package/skills/github-commander/workflows/perf-audit.md +142 -0
  15. package/skills/github-commander/workflows/pr-review.md +123 -0
  16. package/skills/github-commander/workflows/security-audit.md +170 -0
  17. package/skills/github-commander/workflows/update-deps.md +109 -0
  18. package/.dockerignore +0 -139
  19. package/.gitattributes +0 -20
  20. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -95
  21. package/.github/ISSUE_TEMPLATE/config.yml +0 -11
  22. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -110
  23. package/.github/ISSUE_TEMPLATE/question.md +0 -78
  24. package/.github/aw/actions-lock.json +0 -14
  25. package/.github/copilot-instructions.md +0 -122
  26. package/.github/dependabot.yml +0 -93
  27. package/.github/pull_request_template.md +0 -135
  28. package/.github/workflows/README.md +0 -133
  29. package/.github/workflows/agentics-maintenance.yml +0 -141
  30. package/.github/workflows/auto-release.yml +0 -68
  31. package/.github/workflows/ci-health-monitor.lock.yml +0 -1121
  32. package/.github/workflows/ci-health-monitor.md +0 -87
  33. package/.github/workflows/codeql.yml +0 -41
  34. package/.github/workflows/dependabot-auto-merge.yml +0 -42
  35. package/.github/workflows/dependency-maintenance.lock.yml +0 -1182
  36. package/.github/workflows/dependency-maintenance.md +0 -147
  37. package/.github/workflows/docker-publish.yml +0 -254
  38. package/.github/workflows/docs-drift-detector.lock.yml +0 -1142
  39. package/.github/workflows/docs-drift-detector.md +0 -115
  40. package/.github/workflows/lint-and-test.yml +0 -60
  41. package/.github/workflows/publish-npm.yml +0 -85
  42. package/.github/workflows/secrets-scanning.yml +0 -32
  43. package/.github/workflows/security-update.yml +0 -127
  44. package/.gitleaks.toml +0 -9
  45. package/.prettierignore +0 -21
  46. package/.prettierrc +0 -33
  47. package/.scout-ignore +0 -12
  48. package/.trivyignore +0 -21
  49. package/CHANGELOG.md +0 -1814
  50. package/CODE_OF_CONDUCT.md +0 -133
  51. package/CONTRIBUTING.md +0 -263
  52. package/DOCKER_README.md +0 -331
  53. package/Dockerfile +0 -128
  54. package/SECURITY.md +0 -227
  55. package/UNRELEASED.md +0 -1
  56. package/dist/tools-T4U5A3X4.js +0 -2
  57. package/docker-compose.yml +0 -71
  58. package/docs/README.md +0 -18
  59. package/docs/agentic-journal-synergy.md +0 -175
  60. package/docs/copilot-setup.md +0 -72
  61. package/eslint.config.js +0 -110
  62. package/mcp-config-example.json +0 -21
  63. package/playwright.config.ts +0 -35
  64. package/releases/v2.1.0.md +0 -220
  65. package/releases/v2.2.0.md +0 -168
  66. package/releases/v3.0.0.md +0 -237
  67. package/releases/v3.1.0.md +0 -104
  68. package/releases/v3.1.1.md +0 -42
  69. package/releases/v3.1.2.md +0 -40
  70. package/releases/v3.1.3.md +0 -64
  71. package/releases/v3.1.4.md +0 -32
  72. package/releases/v3.1.5.md +0 -44
  73. package/releases/v4.0.0.md +0 -71
  74. package/releases/v4.1.0.md +0 -88
  75. package/releases/v4.2.0.md +0 -90
  76. package/releases/v4.3.0.md +0 -92
  77. package/releases/v4.3.1.md +0 -69
  78. package/releases/v4.4.0.md +0 -120
  79. package/releases/v4.4.1.md +0 -33
  80. package/releases/v4.4.2.md +0 -31
  81. package/releases/v4.5.0.md +0 -116
  82. package/releases/v5.0.0.md +0 -105
  83. package/releases/v5.0.1.md +0 -25
  84. package/releases/v5.1.0.md +0 -83
  85. package/releases/v5.1.1.md +0 -10
  86. package/releases/v6.0.0.md +0 -48
  87. package/releases/v6.0.1.md +0 -36
  88. package/releases/v6.1.0.md +0 -68
  89. package/releases/v6.1.1.md +0 -30
  90. package/releases/v6.1.2.md +0 -23
  91. package/scripts/generate-server-instructions.ts +0 -306
  92. package/scripts/server-instructions-function-body.ts +0 -107
  93. package/scripts/server-instructions-gotchas.ts +0 -45
  94. package/server.json +0 -42
  95. package/social-preview.png +0 -0
  96. package/src/auth/auth-context.ts +0 -78
  97. package/src/auth/authorization-server-discovery.ts +0 -263
  98. package/src/auth/errors.ts +0 -215
  99. package/src/auth/index.ts +0 -58
  100. package/src/auth/middleware.ts +0 -392
  101. package/src/auth/oauth-resource-server.ts +0 -170
  102. package/src/auth/scope-map.ts +0 -46
  103. package/src/auth/scopes.ts +0 -256
  104. package/src/auth/token-validator.ts +0 -293
  105. package/src/auth/transport-agnostic.ts +0 -164
  106. package/src/auth/types.ts +0 -372
  107. package/src/cli.ts +0 -279
  108. package/src/codemode/api-constants.ts +0 -263
  109. package/src/codemode/api.ts +0 -302
  110. package/src/codemode/auto-return.ts +0 -65
  111. package/src/codemode/index.ts +0 -47
  112. package/src/codemode/sandbox-factory.ts +0 -144
  113. package/src/codemode/sandbox.ts +0 -220
  114. package/src/codemode/security.ts +0 -155
  115. package/src/codemode/types.ts +0 -228
  116. package/src/codemode/worker-sandbox.ts +0 -277
  117. package/src/codemode/worker-script.ts +0 -239
  118. package/src/constants/icons.ts +0 -183
  119. package/src/constants/server-instructions.md +0 -166
  120. package/src/constants/server-instructions.ts +0 -514
  121. package/src/database/adapter-factory.ts +0 -16
  122. package/src/database/core/entry-columns.ts +0 -10
  123. package/src/database/core/interfaces.ts +0 -188
  124. package/src/database/core/schema.ts +0 -152
  125. package/src/database/sqlite-adapter/backup.ts +0 -167
  126. package/src/database/sqlite-adapter/entries/crud.ts +0 -233
  127. package/src/database/sqlite-adapter/entries/importance.ts +0 -76
  128. package/src/database/sqlite-adapter/entries/index.ts +0 -142
  129. package/src/database/sqlite-adapter/entries/search.ts +0 -294
  130. package/src/database/sqlite-adapter/entries/shared.ts +0 -102
  131. package/src/database/sqlite-adapter/entries/statistics.ts +0 -162
  132. package/src/database/sqlite-adapter/index.ts +0 -265
  133. package/src/database/sqlite-adapter/native-connection.ts +0 -301
  134. package/src/database/sqlite-adapter/relationships.ts +0 -70
  135. package/src/database/sqlite-adapter/tags.ts +0 -182
  136. package/src/filtering/tool-filter.ts +0 -312
  137. package/src/github/github-integration/client.ts +0 -114
  138. package/src/github/github-integration/index.ts +0 -297
  139. package/src/github/github-integration/insights.ts +0 -155
  140. package/src/github/github-integration/issues.ts +0 -213
  141. package/src/github/github-integration/milestones.ts +0 -262
  142. package/src/github/github-integration/projects.ts +0 -414
  143. package/src/github/github-integration/pull-requests.ts +0 -235
  144. package/src/github/github-integration/repository.ts +0 -110
  145. package/src/github/github-integration/types.ts +0 -43
  146. package/src/handlers/prompts/github.ts +0 -210
  147. package/src/handlers/prompts/index.ts +0 -97
  148. package/src/handlers/prompts/workflow.ts +0 -361
  149. package/src/handlers/resources/core/briefing/context-section.ts +0 -182
  150. package/src/handlers/resources/core/briefing/github-section.ts +0 -354
  151. package/src/handlers/resources/core/briefing/index.ts +0 -106
  152. package/src/handlers/resources/core/briefing/user-message.ts +0 -114
  153. package/src/handlers/resources/core/health.ts +0 -75
  154. package/src/handlers/resources/core/index.ts +0 -31
  155. package/src/handlers/resources/core/instructions.ts +0 -45
  156. package/src/handlers/resources/core/utilities.ts +0 -310
  157. package/src/handlers/resources/github.ts +0 -340
  158. package/src/handlers/resources/graph.ts +0 -218
  159. package/src/handlers/resources/help.ts +0 -410
  160. package/src/handlers/resources/index.ts +0 -143
  161. package/src/handlers/resources/shared.ts +0 -219
  162. package/src/handlers/resources/team.ts +0 -134
  163. package/src/handlers/resources/templates.ts +0 -334
  164. package/src/handlers/tools/admin.ts +0 -351
  165. package/src/handlers/tools/analytics.ts +0 -346
  166. package/src/handlers/tools/backup.ts +0 -272
  167. package/src/handlers/tools/codemode.ts +0 -188
  168. package/src/handlers/tools/core.ts +0 -359
  169. package/src/handlers/tools/error-fields-mixin.ts +0 -10
  170. package/src/handlers/tools/export.ts +0 -150
  171. package/src/handlers/tools/github/copilot-tools.ts +0 -72
  172. package/src/handlers/tools/github/helpers.ts +0 -125
  173. package/src/handlers/tools/github/insights-tools.ts +0 -112
  174. package/src/handlers/tools/github/issue-tools.ts +0 -442
  175. package/src/handlers/tools/github/kanban-tools.ts +0 -153
  176. package/src/handlers/tools/github/milestone-tools.ts +0 -371
  177. package/src/handlers/tools/github/mutation-tools.ts +0 -17
  178. package/src/handlers/tools/github/read-tools.ts +0 -302
  179. package/src/handlers/tools/github/schemas.ts +0 -435
  180. package/src/handlers/tools/github.ts +0 -39
  181. package/src/handlers/tools/index.ts +0 -255
  182. package/src/handlers/tools/relationships.ts +0 -390
  183. package/src/handlers/tools/schemas.ts +0 -165
  184. package/src/handlers/tools/search.ts +0 -448
  185. package/src/handlers/tools/team/admin-tools.ts +0 -164
  186. package/src/handlers/tools/team/analytics-tools.ts +0 -233
  187. package/src/handlers/tools/team/backup-tools.ts +0 -83
  188. package/src/handlers/tools/team/core-tools.ts +0 -197
  189. package/src/handlers/tools/team/export-tools.ts +0 -130
  190. package/src/handlers/tools/team/helpers.ts +0 -66
  191. package/src/handlers/tools/team/index.ts +0 -45
  192. package/src/handlers/tools/team/relationship-tools.ts +0 -219
  193. package/src/handlers/tools/team/schemas.ts +0 -558
  194. package/src/handlers/tools/team/search-tools.ts +0 -145
  195. package/src/handlers/tools/team/vector-tools.ts +0 -261
  196. package/src/index.ts +0 -57
  197. package/src/server/mcp-server.ts +0 -446
  198. package/src/server/registration.ts +0 -141
  199. package/src/server/scheduler.ts +0 -283
  200. package/src/transports/http/handlers.ts +0 -78
  201. package/src/transports/http/index.ts +0 -8
  202. package/src/transports/http/security.ts +0 -147
  203. package/src/transports/http/server/index.ts +0 -397
  204. package/src/transports/http/server/legacy-sse.ts +0 -87
  205. package/src/transports/http/server/stateful.ts +0 -222
  206. package/src/transports/http/server/stateless.ts +0 -42
  207. package/src/transports/http/types.ts +0 -132
  208. package/src/types/entities.ts +0 -145
  209. package/src/types/error-types.ts +0 -92
  210. package/src/types/errors.ts +0 -200
  211. package/src/types/filtering.ts +0 -55
  212. package/src/types/github.ts +0 -216
  213. package/src/types/index.ts +0 -348
  214. package/src/utils/error-helpers.ts +0 -78
  215. package/src/utils/errors/error-response-fields.ts +0 -29
  216. package/src/utils/errors/suggestions.ts +0 -94
  217. package/src/utils/github-helpers.ts +0 -33
  218. package/src/utils/logger.ts +0 -107
  219. package/src/utils/mcp-logger.ts +0 -155
  220. package/src/utils/progress-utils.ts +0 -100
  221. package/src/utils/query-helpers.ts +0 -78
  222. package/src/utils/resource-annotations.ts +0 -75
  223. package/src/utils/security-utils.ts +0 -198
  224. package/src/utils/vector-index-helpers.ts +0 -24
  225. package/src/vector/vector-search-manager.ts +0 -409
  226. package/src/version.ts +0 -15
  227. package/test-server/README.md +0 -193
  228. package/test-server/code-map.md +0 -399
  229. package/test-server/test-agent-experience.md +0 -213
  230. package/test-server/test-filter-instructions.mjs +0 -295
  231. package/test-server/test-instruction-levels.mjs +0 -102
  232. package/test-server/test-preflight.md +0 -55
  233. package/test-server/test-prompts.mjs +0 -185
  234. package/test-server/test-scheduler.mjs +0 -174
  235. package/test-server/test-tool-annotations.mjs +0 -115
  236. package/test-server/test-tools-codemode.md +0 -632
  237. package/test-server/test-tools-codemode2.md +0 -1218
  238. package/test-server/test-tools-team.md +0 -215
  239. package/test-server/test-tools.md +0 -429
  240. package/test-server/test-tools2.md +0 -361
  241. package/test-server/test-tools3.md +0 -396
  242. package/test-server/tool-reference.md +0 -231
  243. package/tests/README.md +0 -54
  244. package/tests/auth/auth-context.test.ts +0 -162
  245. package/tests/auth/authorization-server-discovery.test.ts +0 -265
  246. package/tests/auth/errors.test.ts +0 -170
  247. package/tests/auth/middleware.test.ts +0 -585
  248. package/tests/auth/oauth-resource-server.test.ts +0 -173
  249. package/tests/auth/scope-map.test.ts +0 -66
  250. package/tests/auth/scopes.test.ts +0 -347
  251. package/tests/auth/token-validator.test.ts +0 -271
  252. package/tests/codemode/api.test.ts +0 -396
  253. package/tests/codemode/auto-return.test.ts +0 -167
  254. package/tests/codemode/codemode-tool-handlers.test.ts +0 -197
  255. package/tests/codemode/sandbox-factory.test.ts +0 -152
  256. package/tests/codemode/sandbox.test.ts +0 -190
  257. package/tests/codemode/security.test.ts +0 -242
  258. package/tests/codemode/worker-sandbox.test.ts +0 -106
  259. package/tests/constants/icons.test.ts +0 -101
  260. package/tests/constants/server-instructions.test.ts +0 -514
  261. package/tests/database/crud-workflow-branches.test.ts +0 -418
  262. package/tests/database/database-branches.test.ts +0 -132
  263. package/tests/database/entries-auth-branches.test.ts +0 -390
  264. package/tests/database/native-connection.test.ts +0 -249
  265. package/tests/database/shared-helpers.test.ts +0 -103
  266. package/tests/database/sqlite-adapter.bench.ts +0 -63
  267. package/tests/database/sqlite-adapter.test.ts +0 -690
  268. package/tests/database/tags.test.ts +0 -134
  269. package/tests/e2e/README.md +0 -39
  270. package/tests/e2e/auth.spec.ts +0 -106
  271. package/tests/e2e/codemode-abuse.spec.ts +0 -75
  272. package/tests/e2e/health.spec.ts +0 -63
  273. package/tests/e2e/helpers.ts +0 -139
  274. package/tests/e2e/oauth-discovery.spec.ts +0 -102
  275. package/tests/e2e/oauth-scopes.spec.ts +0 -222
  276. package/tests/e2e/payloads-admin.spec.ts +0 -76
  277. package/tests/e2e/payloads-analytics.spec.ts +0 -37
  278. package/tests/e2e/payloads-backup-restore.spec.ts +0 -102
  279. package/tests/e2e/payloads-backup.spec.ts +0 -44
  280. package/tests/e2e/payloads-codemode-api.spec.ts +0 -131
  281. package/tests/e2e/payloads-codemode-readonly.spec.ts +0 -116
  282. package/tests/e2e/payloads-codemode.spec.ts +0 -116
  283. package/tests/e2e/payloads-core.spec.ts +0 -82
  284. package/tests/e2e/payloads-error-contracts.spec.ts +0 -159
  285. package/tests/e2e/payloads-export.spec.ts +0 -46
  286. package/tests/e2e/payloads-github-degradation.spec.ts +0 -73
  287. package/tests/e2e/payloads-github.spec.ts +0 -176
  288. package/tests/e2e/payloads-relationships.spec.ts +0 -56
  289. package/tests/e2e/payloads-search.spec.ts +0 -64
  290. package/tests/e2e/payloads-team-happy.spec.ts +0 -231
  291. package/tests/e2e/payloads-team.spec.ts +0 -174
  292. package/tests/e2e/prompts-expanded.spec.ts +0 -137
  293. package/tests/e2e/prompts.spec.ts +0 -62
  294. package/tests/e2e/protocols.spec.ts +0 -134
  295. package/tests/e2e/rate-limiting.spec.ts +0 -291
  296. package/tests/e2e/resources-briefing-env.spec.ts +0 -106
  297. package/tests/e2e/resources-complete.spec.ts +0 -180
  298. package/tests/e2e/resources-expanded.spec.ts +0 -83
  299. package/tests/e2e/resources-instructions-levels.spec.ts +0 -145
  300. package/tests/e2e/resources-templates.spec.ts +0 -123
  301. package/tests/e2e/resources.spec.ts +0 -103
  302. package/tests/e2e/scheduler.spec.ts +0 -79
  303. package/tests/e2e/security.spec.ts +0 -112
  304. package/tests/e2e/session-advanced.spec.ts +0 -152
  305. package/tests/e2e/sessions.spec.ts +0 -95
  306. package/tests/e2e/stateless.spec.ts +0 -79
  307. package/tests/e2e/streaming.spec.ts +0 -176
  308. package/tests/e2e/tool-filtering-presets.spec.ts +0 -192
  309. package/tests/e2e/tool-filtering.spec.ts +0 -77
  310. package/tests/e2e/tools.spec.ts +0 -111
  311. package/tests/filtering/tool-filter.test.ts +0 -314
  312. package/tests/github/client-issues-errors.test.ts +0 -433
  313. package/tests/github/github-integration-branches.test.ts +0 -490
  314. package/tests/github/github-integration.test.ts +0 -1015
  315. package/tests/github/github-managers-branches.test.ts +0 -907
  316. package/tests/github/pull-requests.test.ts +0 -334
  317. package/tests/handlers/analytics-branches.test.ts +0 -222
  318. package/tests/handlers/backup-branches.test.ts +0 -270
  319. package/tests/handlers/briefing-context-section.test.ts +0 -388
  320. package/tests/handlers/briefing-github-section.test.ts +0 -392
  321. package/tests/handlers/briefing-user-message.test.ts +0 -405
  322. package/tests/handlers/codemode-tools.test.ts +0 -85
  323. package/tests/handlers/copilot-tools.test.ts +0 -126
  324. package/tests/handlers/error-path-coverage.test.ts +0 -324
  325. package/tests/handlers/export-tools.test.ts +0 -203
  326. package/tests/handlers/github-resource-handlers.test.ts +0 -929
  327. package/tests/handlers/github-tool-handlers.test.ts +0 -1452
  328. package/tests/handlers/handler-error-branches.test.ts +0 -346
  329. package/tests/handlers/help-resource.test.ts +0 -92
  330. package/tests/handlers/prompt-handler-coverage.test.ts +0 -108
  331. package/tests/handlers/prompt-handlers.test.ts +0 -131
  332. package/tests/handlers/resource-handler-coverage.test.ts +0 -281
  333. package/tests/handlers/resource-handlers.test.ts +0 -357
  334. package/tests/handlers/resource-prompt-branches.test.ts +0 -495
  335. package/tests/handlers/search-tool-handlers.test.ts +0 -379
  336. package/tests/handlers/targeted-gap-closure.test.ts +0 -387
  337. package/tests/handlers/team-admin.test.ts +0 -291
  338. package/tests/handlers/team-analytics.test.ts +0 -220
  339. package/tests/handlers/team-core.test.ts +0 -148
  340. package/tests/handlers/team-data.test.ts +0 -198
  341. package/tests/handlers/team-relationships.test.ts +0 -271
  342. package/tests/handlers/team-resource-handlers.test.ts +0 -161
  343. package/tests/handlers/team-search.test.ts +0 -134
  344. package/tests/handlers/team-tool-handlers.test.ts +0 -301
  345. package/tests/handlers/team-vector.test.ts +0 -213
  346. package/tests/handlers/template-github-branches.test.ts +0 -676
  347. package/tests/handlers/tool-annotations.test.ts +0 -90
  348. package/tests/handlers/tool-handler-coverage.test.ts +0 -514
  349. package/tests/handlers/tool-handlers.test.ts +0 -510
  350. package/tests/handlers/tool-output-schemas.test.ts +0 -116
  351. package/tests/handlers/vector-tool-handlers.test.ts +0 -238
  352. package/tests/security/sql-injection.test.ts +0 -284
  353. package/tests/server/mcp-server.bench.ts +0 -55
  354. package/tests/server/mcp-server.test.ts +0 -1326
  355. package/tests/server/scheduler.test.ts +0 -400
  356. package/tests/transports/http-legacy-sse.test.ts +0 -275
  357. package/tests/transports/http-security.test.ts +0 -322
  358. package/tests/transports/http-stateful.test.ts +0 -487
  359. package/tests/transports/http-transport-server.test.ts +0 -301
  360. package/tests/transports/http-transport.test.ts +0 -771
  361. package/tests/utils/github-helpers.test.ts +0 -58
  362. package/tests/utils/logger.test.ts +0 -180
  363. package/tests/utils/mcp-logger.test.ts +0 -211
  364. package/tests/utils/progress-utils.test.ts +0 -156
  365. package/tests/utils/query-helpers.test.ts +0 -80
  366. package/tests/utils/security-utils.test.ts +0 -82
  367. package/tests/vector/vector-search-branches.test.ts +0 -111
  368. package/tests/vector/vector-search-manager.test.ts +0 -375
  369. package/tests/vector/vector-search.bench.ts +0 -48
  370. package/tsconfig.json +0 -42
  371. package/tsup.config.ts +0 -19
  372. package/vitest.config.ts +0 -25
@@ -1,1121 +0,0 @@
1
- #
2
- # ___ _ _
3
- # / _ \ | | (_)
4
- # | |_| | __ _ ___ _ __ | |_ _ ___
5
- # | _ |/ _` |/ _ \ '_ \| __| |/ __|
6
- # | | | | (_| | __/ | | | |_| | (__
7
- # \_| |_/\__, |\___|_| |_|\__|_|\___|
8
- # __/ |
9
- # _ _ |___/
10
- # | | | | / _| |
11
- # | | | | ___ _ __ _ __| |_| | _____ ____
12
- # | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___|
13
- # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
14
- # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
15
- #
16
- # This file was automatically generated by gh-aw (v0.57.2). DO NOT EDIT.
17
- #
18
- # To update this file, edit the corresponding .md file and run:
19
- # gh aw compile
20
- # Not all edits will cause changes to this file.
21
- #
22
- # For more information: https://github.github.com/gh-aw/introduction/overview/
23
- #
24
- # Weekly audit of CI workflows for deprecations, outdated actions, and health issues
25
- #
26
- # gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"51fe070f459d34dc16d4e1c07931fdd5c610cdb432b176bb5d62350feeb51fe0","compiler_version":"v0.57.2","strict":true}
27
-
28
- name: 'CI Health Monitor'
29
- 'on':
30
- schedule:
31
- - cron: '0 14 * * 3'
32
- workflow_dispatch:
33
-
34
- permissions: {}
35
-
36
- concurrency: ci-health-monitor
37
-
38
- run-name: 'CI Health Monitor'
39
-
40
- jobs:
41
- activation:
42
- runs-on: ubuntu-slim
43
- permissions:
44
- contents: read
45
- outputs:
46
- comment_id: ''
47
- comment_repo: ''
48
- model: ${{ steps.generate_aw_info.outputs.model }}
49
- secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }}
50
- steps:
51
- - name: Setup Scripts
52
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
53
- with:
54
- destination: /opt/gh-aw/actions
55
- - name: Generate agentic run info
56
- id: generate_aw_info
57
- env:
58
- GH_AW_INFO_ENGINE_ID: 'copilot'
59
- GH_AW_INFO_ENGINE_NAME: 'GitHub Copilot CLI'
60
- GH_AW_INFO_MODEL: 'claude-opus-4-20250514'
61
- GH_AW_INFO_VERSION: ''
62
- GH_AW_INFO_AGENT_VERSION: 'latest'
63
- GH_AW_INFO_CLI_VERSION: 'v0.57.2'
64
- GH_AW_INFO_WORKFLOW_NAME: 'CI Health Monitor'
65
- GH_AW_INFO_EXPERIMENTAL: 'false'
66
- GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: 'true'
67
- GH_AW_INFO_STAGED: 'false'
68
- GH_AW_INFO_ALLOWED_DOMAINS: '["defaults","node"]'
69
- GH_AW_INFO_FIREWALL_ENABLED: 'true'
70
- GH_AW_INFO_AWF_VERSION: 'v0.23.0'
71
- GH_AW_INFO_AWMG_VERSION: ''
72
- GH_AW_INFO_FIREWALL_TYPE: 'squid'
73
- GH_AW_COMPILED_STRICT: 'true'
74
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
75
- with:
76
- script: |
77
- const { main } = require('/opt/gh-aw/actions/generate_aw_info.cjs');
78
- await main(core, context);
79
- - name: Validate COPILOT_GITHUB_TOKEN secret
80
- id: validate-secret
81
- run: /opt/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default
82
- env:
83
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
84
- - name: Checkout .github and .agents folders
85
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
86
- with:
87
- persist-credentials: false
88
- sparse-checkout: |
89
- .github
90
- .agents
91
- sparse-checkout-cone-mode: true
92
- fetch-depth: 1
93
- - name: Check workflow file timestamps
94
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
95
- env:
96
- GH_AW_WORKFLOW_FILE: 'ci-health-monitor.lock.yml'
97
- with:
98
- script: |
99
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
100
- setupGlobals(core, github, context, exec, io);
101
- const { main } = require('/opt/gh-aw/actions/check_workflow_timestamp_api.cjs');
102
- await main();
103
- - name: Create prompt with built-in context
104
- env:
105
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
106
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
107
- GH_AW_GITHUB_ACTOR: ${{ github.actor }}
108
- GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
109
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
110
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
111
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
112
- GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
113
- GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
114
- GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
115
- run: |
116
- bash /opt/gh-aw/actions/create_prompt_first.sh
117
- {
118
- cat << 'GH_AW_PROMPT_EOF'
119
- <system>
120
- GH_AW_PROMPT_EOF
121
- cat "/opt/gh-aw/prompts/xpia.md"
122
- cat "/opt/gh-aw/prompts/temp_folder_prompt.md"
123
- cat "/opt/gh-aw/prompts/markdown.md"
124
- cat "/opt/gh-aw/prompts/safe_outputs_prompt.md"
125
- cat << 'GH_AW_PROMPT_EOF'
126
- <safe-output-tools>
127
- Tools: create_issue, missing_tool, missing_data, noop
128
- </safe-output-tools>
129
- <github-context>
130
- The following GitHub context information is available for this workflow:
131
- {{#if __GH_AW_GITHUB_ACTOR__ }}
132
- - **actor**: __GH_AW_GITHUB_ACTOR__
133
- {{/if}}
134
- {{#if __GH_AW_GITHUB_REPOSITORY__ }}
135
- - **repository**: __GH_AW_GITHUB_REPOSITORY__
136
- {{/if}}
137
- {{#if __GH_AW_GITHUB_WORKSPACE__ }}
138
- - **workspace**: __GH_AW_GITHUB_WORKSPACE__
139
- {{/if}}
140
- {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }}
141
- - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__
142
- {{/if}}
143
- {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }}
144
- - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__
145
- {{/if}}
146
- {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }}
147
- - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__
148
- {{/if}}
149
- {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }}
150
- - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__
151
- {{/if}}
152
- {{#if __GH_AW_GITHUB_RUN_ID__ }}
153
- - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__
154
- {{/if}}
155
- </github-context>
156
-
157
- GH_AW_PROMPT_EOF
158
- cat << 'GH_AW_PROMPT_EOF'
159
- </system>
160
- GH_AW_PROMPT_EOF
161
- cat << 'GH_AW_PROMPT_EOF'
162
- {{#runtime-import .github/workflows/ci-health-monitor.md}}
163
- GH_AW_PROMPT_EOF
164
- } > "$GH_AW_PROMPT"
165
- - name: Interpolate variables and render templates
166
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
167
- env:
168
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
169
- with:
170
- script: |
171
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
172
- setupGlobals(core, github, context, exec, io);
173
- const { main } = require('/opt/gh-aw/actions/interpolate_prompt.cjs');
174
- await main();
175
- - name: Substitute placeholders
176
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
177
- env:
178
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
179
- GH_AW_GITHUB_ACTOR: ${{ github.actor }}
180
- GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
181
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
182
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
183
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
184
- GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
185
- GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
186
- GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
187
- with:
188
- script: |
189
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
190
- setupGlobals(core, github, context, exec, io);
191
-
192
- const substitutePlaceholders = require('/opt/gh-aw/actions/substitute_placeholders.cjs');
193
-
194
- // Call the substitution function
195
- return await substitutePlaceholders({
196
- file: process.env.GH_AW_PROMPT,
197
- substitutions: {
198
- GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR,
199
- GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID,
200
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER,
201
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER,
202
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER,
203
- GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY,
204
- GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID,
205
- GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE
206
- }
207
- });
208
- - name: Validate prompt placeholders
209
- env:
210
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
211
- run: bash /opt/gh-aw/actions/validate_prompt_placeholders.sh
212
- - name: Print prompt
213
- env:
214
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
215
- run: bash /opt/gh-aw/actions/print_prompt_summary.sh
216
- - name: Upload activation artifact
217
- if: success()
218
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
219
- with:
220
- name: activation
221
- path: |
222
- /tmp/gh-aw/aw_info.json
223
- /tmp/gh-aw/aw-prompts/prompt.txt
224
- retention-days: 1
225
-
226
- agent:
227
- needs: activation
228
- runs-on: ubuntu-latest
229
- permissions: read-all
230
- concurrency:
231
- group: 'gh-aw-copilot-${{ github.workflow }}'
232
- env:
233
- DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
234
- GH_AW_ASSETS_ALLOWED_EXTS: ''
235
- GH_AW_ASSETS_BRANCH: ''
236
- GH_AW_ASSETS_MAX_SIZE_KB: 0
237
- GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
238
- GH_AW_SAFE_OUTPUTS: /opt/gh-aw/safeoutputs/outputs.jsonl
239
- GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /opt/gh-aw/safeoutputs/config.json
240
- GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /opt/gh-aw/safeoutputs/tools.json
241
- GH_AW_WORKFLOW_ID_SANITIZED: cihealthmonitor
242
- outputs:
243
- checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }}
244
- detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }}
245
- detection_success: ${{ steps.detection_conclusion.outputs.success }}
246
- has_patch: ${{ steps.collect_output.outputs.has_patch }}
247
- inference_access_error: ${{ steps.detect-inference-error.outputs.inference_access_error || 'false' }}
248
- model: ${{ needs.activation.outputs.model }}
249
- output: ${{ steps.collect_output.outputs.output }}
250
- output_types: ${{ steps.collect_output.outputs.output_types }}
251
- steps:
252
- - name: Setup Scripts
253
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
254
- with:
255
- destination: /opt/gh-aw/actions
256
- - name: Checkout repository
257
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
258
- with:
259
- persist-credentials: false
260
- - name: Create gh-aw temp directory
261
- run: bash /opt/gh-aw/actions/create_gh_aw_tmp_dir.sh
262
- - name: Configure Git credentials
263
- env:
264
- REPO_NAME: ${{ github.repository }}
265
- SERVER_URL: ${{ github.server_url }}
266
- run: |
267
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
268
- git config --global user.name "github-actions[bot]"
269
- git config --global am.keepcr true
270
- # Re-authenticate git with GitHub token
271
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
272
- git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
273
- echo "Git configured with standard GitHub Actions identity"
274
- - name: Checkout PR branch
275
- id: checkout-pr
276
- if: |
277
- (github.event.pull_request) || (github.event.issue.pull_request)
278
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
279
- env:
280
- GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
281
- with:
282
- github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
283
- script: |
284
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
285
- setupGlobals(core, github, context, exec, io);
286
- const { main } = require('/opt/gh-aw/actions/checkout_pr_branch.cjs');
287
- await main();
288
- - name: Install GitHub Copilot CLI
289
- run: /opt/gh-aw/actions/install_copilot_cli.sh latest
290
- - name: Install awf binary
291
- run: bash /opt/gh-aw/actions/install_awf_binary.sh v0.23.0
292
- - name: Determine automatic lockdown mode for GitHub MCP Server
293
- id: determine-automatic-lockdown
294
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
295
- env:
296
- GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
297
- GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
298
- with:
299
- script: |
300
- const determineAutomaticLockdown = require('/opt/gh-aw/actions/determine_automatic_lockdown.cjs');
301
- await determineAutomaticLockdown(github, context, core);
302
- - name: Download container images
303
- run: bash /opt/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.23.0 ghcr.io/github/gh-aw-firewall/api-proxy:0.23.0 ghcr.io/github/gh-aw-firewall/squid:0.23.0 ghcr.io/github/gh-aw-mcpg:v0.1.8 ghcr.io/github/github-mcp-server:v0.32.0 node:lts-alpine
304
- - name: Write Safe Outputs Config
305
- run: |
306
- mkdir -p /opt/gh-aw/safeoutputs
307
- mkdir -p /tmp/gh-aw/safeoutputs
308
- mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
309
- cat > /opt/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_EOF'
310
- {"create_issue":{"max":1},"missing_data":{},"missing_tool":{},"noop":{"max":1}}
311
- GH_AW_SAFE_OUTPUTS_CONFIG_EOF
312
- cat > /opt/gh-aw/safeoutputs/tools.json << 'GH_AW_SAFE_OUTPUTS_TOOLS_EOF'
313
- [
314
- {
315
- "description": "Create a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead. CONSTRAINTS: Maximum 1 issue(s) can be created. Title will be prefixed with \"[ci-health] \". Labels [\"maintenance\" \"ci-cd\"] will be automatically added.",
316
- "inputSchema": {
317
- "additionalProperties": false,
318
- "properties": {
319
- "body": {
320
- "description": "Detailed issue description in Markdown. Do NOT repeat the title as a heading since it already appears as the issue's h1. Include context, reproduction steps, or acceptance criteria as appropriate.",
321
- "type": "string"
322
- },
323
- "integrity": {
324
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
325
- "type": "string"
326
- },
327
- "labels": {
328
- "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository.",
329
- "items": {
330
- "type": "string"
331
- },
332
- "type": "array"
333
- },
334
- "parent": {
335
- "description": "Parent issue number for creating sub-issues. This is the numeric ID from the GitHub URL (e.g., 42 in github.com/owner/repo/issues/42). Can also be a temporary_id (e.g., 'aw_abc123', 'aw_Test123') from a previously created issue in the same workflow run.",
336
- "type": [
337
- "number",
338
- "string"
339
- ]
340
- },
341
- "secrecy": {
342
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
343
- "type": "string"
344
- },
345
- "temporary_id": {
346
- "description": "Unique temporary identifier for referencing this issue before it's created. Format: 'aw_' followed by 3 to 12 alphanumeric characters (e.g., 'aw_abc1', 'aw_Test123'). Use '#aw_ID' in body text to reference other issues by their temporary_id; these are replaced with actual issue numbers after creation.",
347
- "pattern": "^aw_[A-Za-z0-9]{3,12}$",
348
- "type": "string"
349
- },
350
- "title": {
351
- "description": "Concise issue title summarizing the bug, feature, or task. The title appears as the main heading, so keep it brief and descriptive.",
352
- "type": "string"
353
- }
354
- },
355
- "required": [
356
- "title",
357
- "body"
358
- ],
359
- "type": "object"
360
- },
361
- "name": "create_issue"
362
- },
363
- {
364
- "description": "Report that a tool or capability needed to complete the task is not available, or share any information you deem important about missing functionality or limitations. Use this when you cannot accomplish what was requested because the required functionality is missing or access is restricted.",
365
- "inputSchema": {
366
- "additionalProperties": false,
367
- "properties": {
368
- "alternatives": {
369
- "description": "Any workarounds, manual steps, or alternative approaches the user could take (max 256 characters).",
370
- "type": "string"
371
- },
372
- "integrity": {
373
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
374
- "type": "string"
375
- },
376
- "reason": {
377
- "description": "Explanation of why this tool is needed or what information you want to share about the limitation (max 256 characters).",
378
- "type": "string"
379
- },
380
- "secrecy": {
381
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
382
- "type": "string"
383
- },
384
- "tool": {
385
- "description": "Optional: Name or description of the missing tool or capability (max 128 characters). Be specific about what functionality is needed.",
386
- "type": "string"
387
- }
388
- },
389
- "required": [
390
- "reason"
391
- ],
392
- "type": "object"
393
- },
394
- "name": "missing_tool"
395
- },
396
- {
397
- "description": "Log a transparency message when no significant actions are needed. Use this to confirm workflow completion and provide visibility when analysis is complete but no changes or outputs are required (e.g., 'No issues found', 'All checks passed'). This ensures the workflow produces human-visible output even when no other actions are taken.",
398
- "inputSchema": {
399
- "additionalProperties": false,
400
- "properties": {
401
- "integrity": {
402
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
403
- "type": "string"
404
- },
405
- "message": {
406
- "description": "Status or completion message to log. Should explain what was analyzed and the outcome (e.g., 'Code review complete - no issues found', 'Analysis complete - all tests passing').",
407
- "type": "string"
408
- },
409
- "secrecy": {
410
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
411
- "type": "string"
412
- }
413
- },
414
- "required": [
415
- "message"
416
- ],
417
- "type": "object"
418
- },
419
- "name": "noop"
420
- },
421
- {
422
- "description": "Report that data or information needed to complete the task is not available. Use this when you cannot accomplish what was requested because required data, context, or information is missing.",
423
- "inputSchema": {
424
- "additionalProperties": false,
425
- "properties": {
426
- "alternatives": {
427
- "description": "Any workarounds, manual steps, or alternative approaches the user could take (max 256 characters).",
428
- "type": "string"
429
- },
430
- "context": {
431
- "description": "Additional context about the missing data or where it should come from (max 256 characters).",
432
- "type": "string"
433
- },
434
- "data_type": {
435
- "description": "Type or description of the missing data or information (max 128 characters). Be specific about what data is needed.",
436
- "type": "string"
437
- },
438
- "integrity": {
439
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
440
- "type": "string"
441
- },
442
- "reason": {
443
- "description": "Explanation of why this data is needed to complete the task (max 256 characters).",
444
- "type": "string"
445
- },
446
- "secrecy": {
447
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
448
- "type": "string"
449
- }
450
- },
451
- "required": [],
452
- "type": "object"
453
- },
454
- "name": "missing_data"
455
- }
456
- ]
457
- GH_AW_SAFE_OUTPUTS_TOOLS_EOF
458
- cat > /opt/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_EOF'
459
- {
460
- "create_issue": {
461
- "defaultMax": 1,
462
- "fields": {
463
- "body": {
464
- "required": true,
465
- "type": "string",
466
- "sanitize": true,
467
- "maxLength": 65000
468
- },
469
- "labels": {
470
- "type": "array",
471
- "itemType": "string",
472
- "itemSanitize": true,
473
- "itemMaxLength": 128
474
- },
475
- "parent": {
476
- "issueOrPRNumber": true
477
- },
478
- "repo": {
479
- "type": "string",
480
- "maxLength": 256
481
- },
482
- "temporary_id": {
483
- "type": "string"
484
- },
485
- "title": {
486
- "required": true,
487
- "type": "string",
488
- "sanitize": true,
489
- "maxLength": 128
490
- }
491
- }
492
- },
493
- "missing_data": {
494
- "defaultMax": 20,
495
- "fields": {
496
- "alternatives": {
497
- "type": "string",
498
- "sanitize": true,
499
- "maxLength": 256
500
- },
501
- "context": {
502
- "type": "string",
503
- "sanitize": true,
504
- "maxLength": 256
505
- },
506
- "data_type": {
507
- "type": "string",
508
- "sanitize": true,
509
- "maxLength": 128
510
- },
511
- "reason": {
512
- "type": "string",
513
- "sanitize": true,
514
- "maxLength": 256
515
- }
516
- }
517
- },
518
- "missing_tool": {
519
- "defaultMax": 20,
520
- "fields": {
521
- "alternatives": {
522
- "type": "string",
523
- "sanitize": true,
524
- "maxLength": 512
525
- },
526
- "reason": {
527
- "required": true,
528
- "type": "string",
529
- "sanitize": true,
530
- "maxLength": 256
531
- },
532
- "tool": {
533
- "type": "string",
534
- "sanitize": true,
535
- "maxLength": 128
536
- }
537
- }
538
- },
539
- "noop": {
540
- "defaultMax": 1,
541
- "fields": {
542
- "message": {
543
- "required": true,
544
- "type": "string",
545
- "sanitize": true,
546
- "maxLength": 65000
547
- }
548
- }
549
- }
550
- }
551
- GH_AW_SAFE_OUTPUTS_VALIDATION_EOF
552
- - name: Generate Safe Outputs MCP Server Config
553
- id: safe-outputs-config
554
- run: |
555
- # Generate a secure random API key (360 bits of entropy, 40+ chars)
556
- # Mask immediately to prevent timing vulnerabilities
557
- API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
558
- echo "::add-mask::${API_KEY}"
559
-
560
- PORT=3001
561
-
562
- # Set outputs for next steps
563
- {
564
- echo "safe_outputs_api_key=${API_KEY}"
565
- echo "safe_outputs_port=${PORT}"
566
- } >> "$GITHUB_OUTPUT"
567
-
568
- echo "Safe Outputs MCP server will run on port ${PORT}"
569
-
570
- - name: Start Safe Outputs MCP HTTP Server
571
- id: safe-outputs-start
572
- env:
573
- DEBUG: '*'
574
- GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }}
575
- GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }}
576
- GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /opt/gh-aw/safeoutputs/tools.json
577
- GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /opt/gh-aw/safeoutputs/config.json
578
- GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
579
- run: |
580
- # Environment variables are set above to prevent template injection
581
- export DEBUG
582
- export GH_AW_SAFE_OUTPUTS_PORT
583
- export GH_AW_SAFE_OUTPUTS_API_KEY
584
- export GH_AW_SAFE_OUTPUTS_TOOLS_PATH
585
- export GH_AW_SAFE_OUTPUTS_CONFIG_PATH
586
- export GH_AW_MCP_LOG_DIR
587
-
588
- bash /opt/gh-aw/actions/start_safe_outputs_server.sh
589
-
590
- - name: Start MCP Gateway
591
- id: start-mcp-gateway
592
- env:
593
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
594
- GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }}
595
- GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }}
596
- GITHUB_MCP_LOCKDOWN: ${{ steps.determine-automatic-lockdown.outputs.lockdown == 'true' && '1' || '0' }}
597
- GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
598
- run: |
599
- set -eo pipefail
600
- mkdir -p /tmp/gh-aw/mcp-config
601
-
602
- # Export gateway environment variables for MCP config and gateway script
603
- export MCP_GATEWAY_PORT="80"
604
- export MCP_GATEWAY_DOMAIN="host.docker.internal"
605
- MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
606
- echo "::add-mask::${MCP_GATEWAY_API_KEY}"
607
- export MCP_GATEWAY_API_KEY
608
- export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
609
- mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
610
- export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
611
- export DEBUG="*"
612
-
613
- export GH_AW_ENGINE="copilot"
614
- 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_LOCKDOWN -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.1.8'
615
-
616
- mkdir -p /home/runner/.copilot
617
- cat << GH_AW_MCP_CONFIG_EOF | bash /opt/gh-aw/actions/start_mcp_gateway.sh
618
- {
619
- "mcpServers": {
620
- "github": {
621
- "type": "stdio",
622
- "container": "ghcr.io/github/github-mcp-server:v0.32.0",
623
- "env": {
624
- "GITHUB_LOCKDOWN_MODE": "$GITHUB_MCP_LOCKDOWN",
625
- "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}",
626
- "GITHUB_READ_ONLY": "1",
627
- "GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
628
- }
629
- },
630
- "safeoutputs": {
631
- "type": "http",
632
- "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT",
633
- "headers": {
634
- "Authorization": "\${GH_AW_SAFE_OUTPUTS_API_KEY}"
635
- }
636
- }
637
- },
638
- "gateway": {
639
- "port": $MCP_GATEWAY_PORT,
640
- "domain": "${MCP_GATEWAY_DOMAIN}",
641
- "apiKey": "${MCP_GATEWAY_API_KEY}",
642
- "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
643
- }
644
- }
645
- GH_AW_MCP_CONFIG_EOF
646
- - name: Download activation artifact
647
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
648
- with:
649
- name: activation
650
- path: /tmp/gh-aw
651
- - name: Clean git credentials
652
- run: bash /opt/gh-aw/actions/clean_git_credentials.sh
653
- - name: Execute GitHub Copilot CLI
654
- id: agentic_execution
655
- # Copilot CLI tool arguments (sorted):
656
- timeout-minutes: 15
657
- run: |
658
- set -o pipefail
659
- touch /tmp/gh-aw/agent-step-summary.md
660
- # shellcheck disable=SC1003
661
- sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --allow-domains "*.jsr.io,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.npms.io,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,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,deb.nodesource.com,deno.land,esm.sh,get.pnpm.io,github.com,googleapis.deno.dev,googlechromelabs.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,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,ppa.launchpad.net,raw.githubusercontent.com,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.npmjs.com,www.npmjs.org,yarnpkg.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.23.0 --skip-pull --enable-api-proxy \
662
- -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-all-tools --allow-all-paths --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
663
- env:
664
- COPILOT_AGENT_RUNNER_TYPE: STANDALONE
665
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
666
- COPILOT_MODEL: claude-opus-4-20250514
667
- GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json
668
- GH_AW_PHASE: agent
669
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
670
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
671
- GH_AW_VERSION: v0.57.2
672
- GITHUB_API_URL: ${{ github.api_url }}
673
- GITHUB_AW: true
674
- GITHUB_HEAD_REF: ${{ github.head_ref }}
675
- GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
676
- GITHUB_REF_NAME: ${{ github.ref_name }}
677
- GITHUB_SERVER_URL: ${{ github.server_url }}
678
- GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
679
- GITHUB_WORKSPACE: ${{ github.workspace }}
680
- GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
681
- GIT_AUTHOR_NAME: github-actions[bot]
682
- GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
683
- GIT_COMMITTER_NAME: github-actions[bot]
684
- XDG_CONFIG_HOME: /home/runner
685
- - name: Detect inference access error
686
- id: detect-inference-error
687
- if: always()
688
- continue-on-error: true
689
- run: bash /opt/gh-aw/actions/detect_inference_access_error.sh
690
- - name: Configure Git credentials
691
- env:
692
- REPO_NAME: ${{ github.repository }}
693
- SERVER_URL: ${{ github.server_url }}
694
- run: |
695
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
696
- git config --global user.name "github-actions[bot]"
697
- git config --global am.keepcr true
698
- # Re-authenticate git with GitHub token
699
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
700
- git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
701
- echo "Git configured with standard GitHub Actions identity"
702
- - name: Copy Copilot session state files to logs
703
- if: always()
704
- continue-on-error: true
705
- run: |
706
- # Copy Copilot session state files to logs folder for artifact collection
707
- # This ensures they are in /tmp/gh-aw/ where secret redaction can scan them
708
- SESSION_STATE_DIR="$HOME/.copilot/session-state"
709
- LOGS_DIR="/tmp/gh-aw/sandbox/agent/logs"
710
-
711
- if [ -d "$SESSION_STATE_DIR" ]; then
712
- echo "Copying Copilot session state files from $SESSION_STATE_DIR to $LOGS_DIR"
713
- mkdir -p "$LOGS_DIR"
714
- cp -v "$SESSION_STATE_DIR"/*.jsonl "$LOGS_DIR/" 2>/dev/null || true
715
- echo "Session state files copied successfully"
716
- else
717
- echo "No session-state directory found at $SESSION_STATE_DIR"
718
- fi
719
- - name: Stop MCP Gateway
720
- if: always()
721
- continue-on-error: true
722
- env:
723
- MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
724
- MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
725
- GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }}
726
- run: |
727
- bash /opt/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID"
728
- - name: Redact secrets in logs
729
- if: always()
730
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
731
- with:
732
- script: |
733
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
734
- setupGlobals(core, github, context, exec, io);
735
- const { main } = require('/opt/gh-aw/actions/redact_secrets.cjs');
736
- await main();
737
- env:
738
- GH_AW_SECRET_NAMES: 'COPILOT_GITHUB_TOKEN,GH_AW_GITHUB_MCP_SERVER_TOKEN,GH_AW_GITHUB_TOKEN,GITHUB_TOKEN'
739
- SECRET_COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
740
- SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
741
- SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
742
- SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
743
- - name: Append agent step summary
744
- if: always()
745
- run: bash /opt/gh-aw/actions/append_agent_step_summary.sh
746
- - name: Upload Safe Outputs
747
- if: always()
748
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
749
- with:
750
- name: safe-output
751
- path: ${{ env.GH_AW_SAFE_OUTPUTS }}
752
- if-no-files-found: warn
753
- - name: Ingest agent output
754
- id: collect_output
755
- if: always()
756
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
757
- env:
758
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
759
- GH_AW_ALLOWED_DOMAINS: '*.jsr.io,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.npms.io,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,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,deb.nodesource.com,deno.land,esm.sh,get.pnpm.io,github.com,googleapis.deno.dev,googlechromelabs.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,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,ppa.launchpad.net,raw.githubusercontent.com,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.npmjs.com,www.npmjs.org,yarnpkg.com'
760
- GITHUB_SERVER_URL: ${{ github.server_url }}
761
- GITHUB_API_URL: ${{ github.api_url }}
762
- with:
763
- script: |
764
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
765
- setupGlobals(core, github, context, exec, io);
766
- const { main } = require('/opt/gh-aw/actions/collect_ndjson_output.cjs');
767
- await main();
768
- - name: Upload sanitized agent output
769
- if: always() && env.GH_AW_AGENT_OUTPUT
770
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
771
- with:
772
- name: agent-output
773
- path: ${{ env.GH_AW_AGENT_OUTPUT }}
774
- if-no-files-found: warn
775
- - name: Upload engine output files
776
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
777
- with:
778
- name: agent_outputs
779
- path: |
780
- /tmp/gh-aw/sandbox/agent/logs/
781
- /tmp/gh-aw/redacted-urls.log
782
- if-no-files-found: ignore
783
- - name: Parse agent logs for step summary
784
- if: always()
785
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
786
- env:
787
- GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/
788
- with:
789
- script: |
790
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
791
- setupGlobals(core, github, context, exec, io);
792
- const { main } = require('/opt/gh-aw/actions/parse_copilot_log.cjs');
793
- await main();
794
- - name: Parse MCP Gateway logs for step summary
795
- if: always()
796
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
797
- with:
798
- script: |
799
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
800
- setupGlobals(core, github, context, exec, io);
801
- const { main } = require('/opt/gh-aw/actions/parse_mcp_gateway_log.cjs');
802
- await main();
803
- - name: Print firewall logs
804
- if: always()
805
- continue-on-error: true
806
- env:
807
- AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
808
- run: |
809
- # Fix permissions on firewall logs so they can be uploaded as artifacts
810
- # AWF runs with sudo, creating files owned by root
811
- sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true
812
- # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step)
813
- if command -v awf &> /dev/null; then
814
- awf logs summary | tee -a "$GITHUB_STEP_SUMMARY"
815
- else
816
- echo 'AWF binary not installed, skipping firewall log summary'
817
- fi
818
- - name: Upload agent artifacts
819
- if: always()
820
- continue-on-error: true
821
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
822
- with:
823
- name: agent-artifacts
824
- path: |
825
- /tmp/gh-aw/aw-prompts/prompt.txt
826
- /tmp/gh-aw/mcp-logs/
827
- /tmp/gh-aw/sandbox/firewall/logs/
828
- /tmp/gh-aw/agent-stdio.log
829
- /tmp/gh-aw/agent/
830
- if-no-files-found: ignore
831
- # --- Threat Detection (inline) ---
832
- - name: Check if detection needed
833
- id: detection_guard
834
- if: always()
835
- env:
836
- OUTPUT_TYPES: ${{ steps.collect_output.outputs.output_types }}
837
- HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }}
838
- run: |
839
- if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then
840
- echo "run_detection=true" >> "$GITHUB_OUTPUT"
841
- echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH"
842
- else
843
- echo "run_detection=false" >> "$GITHUB_OUTPUT"
844
- echo "Detection skipped: no agent outputs or patches to analyze"
845
- fi
846
- - name: Clear MCP configuration for detection
847
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
848
- run: |
849
- rm -f /tmp/gh-aw/mcp-config/mcp-servers.json
850
- rm -f /home/runner/.copilot/mcp-config.json
851
- rm -f "$GITHUB_WORKSPACE/.gemini/settings.json"
852
- - name: Prepare threat detection files
853
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
854
- run: |
855
- mkdir -p /tmp/gh-aw/threat-detection/aw-prompts
856
- cp /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt 2>/dev/null || true
857
- cp /tmp/gh-aw/agent_output.json /tmp/gh-aw/threat-detection/agent_output.json 2>/dev/null || true
858
- for f in /tmp/gh-aw/aw-*.patch; do
859
- [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
860
- done
861
- echo "Prepared threat detection files:"
862
- ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true
863
- - name: Setup threat detection
864
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
865
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
866
- env:
867
- WORKFLOW_NAME: 'CI Health Monitor'
868
- WORKFLOW_DESCRIPTION: 'Weekly audit of CI workflows for deprecations, outdated actions, and health issues'
869
- HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }}
870
- with:
871
- script: |
872
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
873
- setupGlobals(core, github, context, exec, io);
874
- const { main } = require('/opt/gh-aw/actions/setup_threat_detection.cjs');
875
- await main();
876
- - name: Ensure threat-detection directory and log
877
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
878
- run: |
879
- mkdir -p /tmp/gh-aw/threat-detection
880
- touch /tmp/gh-aw/threat-detection/detection.log
881
- - name: Execute GitHub Copilot CLI
882
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
883
- id: detection_agentic_execution
884
- # Copilot CLI tool arguments (sorted):
885
- # --allow-tool shell(cat)
886
- # --allow-tool shell(grep)
887
- # --allow-tool shell(head)
888
- # --allow-tool shell(jq)
889
- # --allow-tool shell(ls)
890
- # --allow-tool shell(tail)
891
- # --allow-tool shell(wc)
892
- timeout-minutes: 20
893
- run: |
894
- set -o pipefail
895
- touch /tmp/gh-aw/agent-step-summary.md
896
- # shellcheck disable=SC1003
897
- sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --allow-domains "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,github.com,host.docker.internal,raw.githubusercontent.com,registry.npmjs.org,telemetry.enterprise.githubcopilot.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.23.0 --skip-pull --enable-api-proxy \
898
- -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-tool '\''shell(cat)'\'' --allow-tool '\''shell(grep)'\'' --allow-tool '\''shell(head)'\'' --allow-tool '\''shell(jq)'\'' --allow-tool '\''shell(ls)'\'' --allow-tool '\''shell(tail)'\'' --allow-tool '\''shell(wc)'\'' --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log
899
- env:
900
- COPILOT_AGENT_RUNNER_TYPE: STANDALONE
901
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
902
- COPILOT_MODEL: claude-opus-4-20250514
903
- GH_AW_PHASE: detection
904
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
905
- GH_AW_VERSION: v0.57.2
906
- GITHUB_API_URL: ${{ github.api_url }}
907
- GITHUB_AW: true
908
- GITHUB_HEAD_REF: ${{ github.head_ref }}
909
- GITHUB_REF_NAME: ${{ github.ref_name }}
910
- GITHUB_SERVER_URL: ${{ github.server_url }}
911
- GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
912
- GITHUB_WORKSPACE: ${{ github.workspace }}
913
- GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
914
- GIT_AUTHOR_NAME: github-actions[bot]
915
- GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
916
- GIT_COMMITTER_NAME: github-actions[bot]
917
- XDG_CONFIG_HOME: /home/runner
918
- - name: Parse threat detection results
919
- id: parse_detection_results
920
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
921
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
922
- with:
923
- script: |
924
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
925
- setupGlobals(core, github, context, exec, io);
926
- const { main } = require('/opt/gh-aw/actions/parse_threat_detection_results.cjs');
927
- await main();
928
- - name: Upload threat detection log
929
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
930
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
931
- with:
932
- name: threat-detection.log
933
- path: /tmp/gh-aw/threat-detection/detection.log
934
- if-no-files-found: ignore
935
- - name: Set detection conclusion
936
- id: detection_conclusion
937
- if: always()
938
- env:
939
- RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
940
- DETECTION_SUCCESS: ${{ steps.parse_detection_results.outputs.success }}
941
- run: |
942
- if [[ "$RUN_DETECTION" != "true" ]]; then
943
- echo "conclusion=skipped" >> "$GITHUB_OUTPUT"
944
- echo "success=true" >> "$GITHUB_OUTPUT"
945
- echo "Detection was not needed, marking as skipped"
946
- elif [[ "$DETECTION_SUCCESS" == "true" ]]; then
947
- echo "conclusion=success" >> "$GITHUB_OUTPUT"
948
- echo "success=true" >> "$GITHUB_OUTPUT"
949
- echo "Detection passed successfully"
950
- else
951
- echo "conclusion=failure" >> "$GITHUB_OUTPUT"
952
- echo "success=false" >> "$GITHUB_OUTPUT"
953
- echo "Detection found issues"
954
- fi
955
-
956
- conclusion:
957
- needs:
958
- - activation
959
- - agent
960
- - safe_outputs
961
- if: (always()) && (needs.agent.result != 'skipped')
962
- runs-on: ubuntu-slim
963
- permissions:
964
- contents: read
965
- issues: write
966
- concurrency:
967
- group: 'gh-aw-conclusion-ci-health-monitor'
968
- cancel-in-progress: false
969
- outputs:
970
- noop_message: ${{ steps.noop.outputs.noop_message }}
971
- tools_reported: ${{ steps.missing_tool.outputs.tools_reported }}
972
- total_count: ${{ steps.missing_tool.outputs.total_count }}
973
- steps:
974
- - name: Setup Scripts
975
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
976
- with:
977
- destination: /opt/gh-aw/actions
978
- - name: Download agent output artifact
979
- id: download-agent-output
980
- continue-on-error: true
981
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
982
- with:
983
- name: agent-output
984
- path: /tmp/gh-aw/safeoutputs/
985
- - name: Setup agent output environment variable
986
- if: steps.download-agent-output.outcome == 'success'
987
- run: |
988
- mkdir -p /tmp/gh-aw/safeoutputs/
989
- find "/tmp/gh-aw/safeoutputs/" -type f -print
990
- echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
991
- - name: Process No-Op Messages
992
- id: noop
993
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
994
- env:
995
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
996
- GH_AW_NOOP_MAX: '1'
997
- GH_AW_WORKFLOW_NAME: 'CI Health Monitor'
998
- with:
999
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1000
- script: |
1001
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1002
- setupGlobals(core, github, context, exec, io);
1003
- const { main } = require('/opt/gh-aw/actions/noop.cjs');
1004
- await main();
1005
- - name: Record Missing Tool
1006
- id: missing_tool
1007
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1008
- env:
1009
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1010
- GH_AW_WORKFLOW_NAME: 'CI Health Monitor'
1011
- with:
1012
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1013
- script: |
1014
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1015
- setupGlobals(core, github, context, exec, io);
1016
- const { main } = require('/opt/gh-aw/actions/missing_tool.cjs');
1017
- await main();
1018
- - name: Handle Agent Failure
1019
- id: handle_agent_failure
1020
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1021
- env:
1022
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1023
- GH_AW_WORKFLOW_NAME: 'CI Health Monitor'
1024
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1025
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
1026
- GH_AW_WORKFLOW_ID: 'ci-health-monitor'
1027
- GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
1028
- GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
1029
- GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }}
1030
- GH_AW_GROUP_REPORTS: 'false'
1031
- GH_AW_FAILURE_REPORT_AS_ISSUE: 'true'
1032
- GH_AW_TIMEOUT_MINUTES: '15'
1033
- with:
1034
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1035
- script: |
1036
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1037
- setupGlobals(core, github, context, exec, io);
1038
- const { main } = require('/opt/gh-aw/actions/handle_agent_failure.cjs');
1039
- await main();
1040
- - name: Handle No-Op Message
1041
- id: handle_noop_message
1042
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1043
- env:
1044
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1045
- GH_AW_WORKFLOW_NAME: 'CI Health Monitor'
1046
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1047
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
1048
- GH_AW_NOOP_MESSAGE: ${{ steps.noop.outputs.noop_message }}
1049
- GH_AW_NOOP_REPORT_AS_ISSUE: 'true'
1050
- with:
1051
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1052
- script: |
1053
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1054
- setupGlobals(core, github, context, exec, io);
1055
- const { main } = require('/opt/gh-aw/actions/handle_noop_message.cjs');
1056
- await main();
1057
-
1058
- safe_outputs:
1059
- needs: agent
1060
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (needs.agent.outputs.detection_success == 'true')
1061
- runs-on: ubuntu-slim
1062
- permissions:
1063
- contents: read
1064
- issues: write
1065
- timeout-minutes: 15
1066
- env:
1067
- GH_AW_CALLER_WORKFLOW_ID: '${{ github.repository }}/ci-health-monitor'
1068
- GH_AW_ENGINE_ID: 'copilot'
1069
- GH_AW_ENGINE_MODEL: 'claude-opus-4-20250514'
1070
- GH_AW_WORKFLOW_ID: 'ci-health-monitor'
1071
- GH_AW_WORKFLOW_NAME: 'CI Health Monitor'
1072
- outputs:
1073
- code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }}
1074
- code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }}
1075
- create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}
1076
- create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}
1077
- created_issue_number: ${{ steps.process_safe_outputs.outputs.created_issue_number }}
1078
- created_issue_url: ${{ steps.process_safe_outputs.outputs.created_issue_url }}
1079
- process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
1080
- process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
1081
- steps:
1082
- - name: Setup Scripts
1083
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
1084
- with:
1085
- destination: /opt/gh-aw/actions
1086
- - name: Download agent output artifact
1087
- id: download-agent-output
1088
- continue-on-error: true
1089
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
1090
- with:
1091
- name: agent-output
1092
- path: /tmp/gh-aw/safeoutputs/
1093
- - name: Setup agent output environment variable
1094
- if: steps.download-agent-output.outcome == 'success'
1095
- run: |
1096
- mkdir -p /tmp/gh-aw/safeoutputs/
1097
- find "/tmp/gh-aw/safeoutputs/" -type f -print
1098
- echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
1099
- - name: Process Safe Outputs
1100
- id: process_safe_outputs
1101
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1102
- env:
1103
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1104
- GH_AW_ALLOWED_DOMAINS: '*.jsr.io,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.npms.io,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,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,deb.nodesource.com,deno.land,esm.sh,get.pnpm.io,github.com,googleapis.deno.dev,googlechromelabs.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,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,ppa.launchpad.net,raw.githubusercontent.com,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.npmjs.com,www.npmjs.org,yarnpkg.com'
1105
- GITHUB_SERVER_URL: ${{ github.server_url }}
1106
- GITHUB_API_URL: ${{ github.api_url }}
1107
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: '{"create_issue":{"labels":["maintenance","ci-cd"],"max":1,"title_prefix":"[ci-health] "},"missing_data":{},"missing_tool":{}}'
1108
- with:
1109
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1110
- script: |
1111
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1112
- setupGlobals(core, github, context, exec, io);
1113
- const { main } = require('/opt/gh-aw/actions/safe_output_handler_manager.cjs');
1114
- await main();
1115
- - name: Upload safe output items manifest
1116
- if: always()
1117
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
1118
- with:
1119
- name: safe-output-items
1120
- path: /tmp/safe-output-items.jsonl
1121
- if-no-files-found: warn