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,1182 +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
- # Automated dependency maintenance — npm, Docker transitive deps, Alpine packages, and validation (no version bump)
25
- #
26
- # gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"b286dbe799e0162eca1d2992f25a5b3758c8f1adfa06330cb7e6a63e2173017d","compiler_version":"v0.57.2","strict":true}
27
-
28
- name: 'Dependency Maintenance Agent'
29
- 'on':
30
- schedule:
31
- - cron: '0 14 * * 1'
32
- workflow_dispatch:
33
-
34
- permissions: {}
35
-
36
- concurrency: dependency-maintenance
37
-
38
- run-name: 'Dependency Maintenance Agent'
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: 'Dependency Maintenance Agent'
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: 'dependency-maintenance.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_pull_request, missing_tool, missing_data, noop
128
- GH_AW_PROMPT_EOF
129
- cat "/opt/gh-aw/prompts/safe_outputs_create_pull_request.md"
130
- cat << 'GH_AW_PROMPT_EOF'
131
- </safe-output-tools>
132
- <github-context>
133
- The following GitHub context information is available for this workflow:
134
- {{#if __GH_AW_GITHUB_ACTOR__ }}
135
- - **actor**: __GH_AW_GITHUB_ACTOR__
136
- {{/if}}
137
- {{#if __GH_AW_GITHUB_REPOSITORY__ }}
138
- - **repository**: __GH_AW_GITHUB_REPOSITORY__
139
- {{/if}}
140
- {{#if __GH_AW_GITHUB_WORKSPACE__ }}
141
- - **workspace**: __GH_AW_GITHUB_WORKSPACE__
142
- {{/if}}
143
- {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }}
144
- - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__
145
- {{/if}}
146
- {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }}
147
- - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__
148
- {{/if}}
149
- {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }}
150
- - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__
151
- {{/if}}
152
- {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }}
153
- - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__
154
- {{/if}}
155
- {{#if __GH_AW_GITHUB_RUN_ID__ }}
156
- - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__
157
- {{/if}}
158
- </github-context>
159
-
160
- GH_AW_PROMPT_EOF
161
- cat << 'GH_AW_PROMPT_EOF'
162
- </system>
163
- GH_AW_PROMPT_EOF
164
- cat << 'GH_AW_PROMPT_EOF'
165
- {{#runtime-import .github/workflows/dependency-maintenance.md}}
166
- GH_AW_PROMPT_EOF
167
- } > "$GH_AW_PROMPT"
168
- - name: Interpolate variables and render templates
169
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
170
- env:
171
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
172
- with:
173
- script: |
174
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
175
- setupGlobals(core, github, context, exec, io);
176
- const { main } = require('/opt/gh-aw/actions/interpolate_prompt.cjs');
177
- await main();
178
- - name: Substitute placeholders
179
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
180
- env:
181
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
182
- GH_AW_GITHUB_ACTOR: ${{ github.actor }}
183
- GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
184
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
185
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
186
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
187
- GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
188
- GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
189
- GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
190
- with:
191
- script: |
192
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
193
- setupGlobals(core, github, context, exec, io);
194
-
195
- const substitutePlaceholders = require('/opt/gh-aw/actions/substitute_placeholders.cjs');
196
-
197
- // Call the substitution function
198
- return await substitutePlaceholders({
199
- file: process.env.GH_AW_PROMPT,
200
- substitutions: {
201
- GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR,
202
- GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID,
203
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER,
204
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER,
205
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER,
206
- GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY,
207
- GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID,
208
- GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE
209
- }
210
- });
211
- - name: Validate prompt placeholders
212
- env:
213
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
214
- run: bash /opt/gh-aw/actions/validate_prompt_placeholders.sh
215
- - name: Print prompt
216
- env:
217
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
218
- run: bash /opt/gh-aw/actions/print_prompt_summary.sh
219
- - name: Upload activation artifact
220
- if: success()
221
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
222
- with:
223
- name: activation
224
- path: |
225
- /tmp/gh-aw/aw_info.json
226
- /tmp/gh-aw/aw-prompts/prompt.txt
227
- retention-days: 1
228
-
229
- agent:
230
- needs: activation
231
- runs-on: ubuntu-latest
232
- permissions: read-all
233
- concurrency:
234
- group: 'gh-aw-copilot-${{ github.workflow }}'
235
- env:
236
- DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
237
- GH_AW_ASSETS_ALLOWED_EXTS: ''
238
- GH_AW_ASSETS_BRANCH: ''
239
- GH_AW_ASSETS_MAX_SIZE_KB: 0
240
- GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
241
- GH_AW_SAFE_OUTPUTS: /opt/gh-aw/safeoutputs/outputs.jsonl
242
- GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /opt/gh-aw/safeoutputs/config.json
243
- GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /opt/gh-aw/safeoutputs/tools.json
244
- GH_AW_WORKFLOW_ID_SANITIZED: dependencymaintenance
245
- outputs:
246
- checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }}
247
- detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }}
248
- detection_success: ${{ steps.detection_conclusion.outputs.success }}
249
- has_patch: ${{ steps.collect_output.outputs.has_patch }}
250
- inference_access_error: ${{ steps.detect-inference-error.outputs.inference_access_error || 'false' }}
251
- model: ${{ needs.activation.outputs.model }}
252
- output: ${{ steps.collect_output.outputs.output }}
253
- output_types: ${{ steps.collect_output.outputs.output_types }}
254
- steps:
255
- - name: Setup Scripts
256
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
257
- with:
258
- destination: /opt/gh-aw/actions
259
- - name: Checkout repository
260
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
261
- with:
262
- persist-credentials: false
263
- - name: Setup Node.js
264
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
265
- with:
266
- node-version: '24'
267
- package-manager-cache: false
268
- - name: Create gh-aw temp directory
269
- run: bash /opt/gh-aw/actions/create_gh_aw_tmp_dir.sh
270
- - name: Configure Git credentials
271
- env:
272
- REPO_NAME: ${{ github.repository }}
273
- SERVER_URL: ${{ github.server_url }}
274
- run: |
275
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
276
- git config --global user.name "github-actions[bot]"
277
- git config --global am.keepcr true
278
- # Re-authenticate git with GitHub token
279
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
280
- git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
281
- echo "Git configured with standard GitHub Actions identity"
282
- - name: Checkout PR branch
283
- id: checkout-pr
284
- if: |
285
- (github.event.pull_request) || (github.event.issue.pull_request)
286
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
287
- env:
288
- GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
289
- with:
290
- github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
291
- script: |
292
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
293
- setupGlobals(core, github, context, exec, io);
294
- const { main } = require('/opt/gh-aw/actions/checkout_pr_branch.cjs');
295
- await main();
296
- - name: Install GitHub Copilot CLI
297
- run: /opt/gh-aw/actions/install_copilot_cli.sh latest
298
- - name: Install awf binary
299
- run: bash /opt/gh-aw/actions/install_awf_binary.sh v0.23.0
300
- - name: Determine automatic lockdown mode for GitHub MCP Server
301
- id: determine-automatic-lockdown
302
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
303
- env:
304
- GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
305
- GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
306
- with:
307
- script: |
308
- const determineAutomaticLockdown = require('/opt/gh-aw/actions/determine_automatic_lockdown.cjs');
309
- await determineAutomaticLockdown(github, context, core);
310
- - name: Download container images
311
- 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
312
- - name: Write Safe Outputs Config
313
- run: |
314
- mkdir -p /opt/gh-aw/safeoutputs
315
- mkdir -p /tmp/gh-aw/safeoutputs
316
- mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
317
- cat > /opt/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_EOF'
318
- {"create_pull_request":{"expires":336,"fallback_as_issue":true,"max":1,"reviewers":["neverinfamous"],"title_prefix":"[deps] "},"missing_data":{},"missing_tool":{},"noop":{"max":1}}
319
- GH_AW_SAFE_OUTPUTS_CONFIG_EOF
320
- cat > /opt/gh-aw/safeoutputs/tools.json << 'GH_AW_SAFE_OUTPUTS_TOOLS_EOF'
321
- [
322
- {
323
- "description": "Create a new GitHub pull request to propose code changes. Use this after making file edits to submit them for review and merging. The PR will be created from the current branch with your committed changes. For code review comments on an existing PR, use create_pull_request_review_comment instead. CONSTRAINTS: Maximum 1 pull request(s) can be created. Title will be prefixed with \"[deps] \". Labels [\"dependencies\" \"automated\"] will be automatically added. Reviewers [\"neverinfamous\"] will be assigned.",
324
- "inputSchema": {
325
- "additionalProperties": false,
326
- "properties": {
327
- "body": {
328
- "description": "Detailed PR description in Markdown. Include what changes were made, why, testing notes, and any breaking changes. Do NOT repeat the title as a heading.",
329
- "type": "string"
330
- },
331
- "branch": {
332
- "description": "Source branch name containing the changes. If omitted, uses the current working branch.",
333
- "type": "string"
334
- },
335
- "draft": {
336
- "description": "Whether to create the PR as a draft. Draft PRs cannot be merged until marked as ready for review. Use mark_pull_request_as_ready_for_review to convert a draft PR. Default: true.",
337
- "type": "boolean"
338
- },
339
- "integrity": {
340
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
341
- "type": "string"
342
- },
343
- "labels": {
344
- "description": "Labels to categorize the PR (e.g., 'enhancement', 'bugfix'). Labels must exist in the repository.",
345
- "items": {
346
- "type": "string"
347
- },
348
- "type": "array"
349
- },
350
- "repo": {
351
- "description": "Target repository in 'owner/repo' format. For multi-repo workflows where the target repo differs from the workflow repo, this must match a repo in the allowed-repos list or the configured target-repo. If omitted, defaults to the configured target-repo (from safe-outputs config), NOT the workflow repository. In most cases, you should omit this parameter and let the system use the configured default.",
352
- "type": "string"
353
- },
354
- "secrecy": {
355
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
356
- "type": "string"
357
- },
358
- "title": {
359
- "description": "Concise PR title describing the changes. Follow repository conventions (e.g., conventional commits). The title appears as the main heading.",
360
- "type": "string"
361
- }
362
- },
363
- "required": [
364
- "title",
365
- "body"
366
- ],
367
- "type": "object"
368
- },
369
- "name": "create_pull_request"
370
- },
371
- {
372
- "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.",
373
- "inputSchema": {
374
- "additionalProperties": false,
375
- "properties": {
376
- "alternatives": {
377
- "description": "Any workarounds, manual steps, or alternative approaches the user could take (max 256 characters).",
378
- "type": "string"
379
- },
380
- "integrity": {
381
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
382
- "type": "string"
383
- },
384
- "reason": {
385
- "description": "Explanation of why this tool is needed or what information you want to share about the limitation (max 256 characters).",
386
- "type": "string"
387
- },
388
- "secrecy": {
389
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
390
- "type": "string"
391
- },
392
- "tool": {
393
- "description": "Optional: Name or description of the missing tool or capability (max 128 characters). Be specific about what functionality is needed.",
394
- "type": "string"
395
- }
396
- },
397
- "required": [
398
- "reason"
399
- ],
400
- "type": "object"
401
- },
402
- "name": "missing_tool"
403
- },
404
- {
405
- "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.",
406
- "inputSchema": {
407
- "additionalProperties": false,
408
- "properties": {
409
- "integrity": {
410
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
411
- "type": "string"
412
- },
413
- "message": {
414
- "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').",
415
- "type": "string"
416
- },
417
- "secrecy": {
418
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
419
- "type": "string"
420
- }
421
- },
422
- "required": [
423
- "message"
424
- ],
425
- "type": "object"
426
- },
427
- "name": "noop"
428
- },
429
- {
430
- "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.",
431
- "inputSchema": {
432
- "additionalProperties": false,
433
- "properties": {
434
- "alternatives": {
435
- "description": "Any workarounds, manual steps, or alternative approaches the user could take (max 256 characters).",
436
- "type": "string"
437
- },
438
- "context": {
439
- "description": "Additional context about the missing data or where it should come from (max 256 characters).",
440
- "type": "string"
441
- },
442
- "data_type": {
443
- "description": "Type or description of the missing data or information (max 128 characters). Be specific about what data is needed.",
444
- "type": "string"
445
- },
446
- "integrity": {
447
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
448
- "type": "string"
449
- },
450
- "reason": {
451
- "description": "Explanation of why this data is needed to complete the task (max 256 characters).",
452
- "type": "string"
453
- },
454
- "secrecy": {
455
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
456
- "type": "string"
457
- }
458
- },
459
- "required": [],
460
- "type": "object"
461
- },
462
- "name": "missing_data"
463
- }
464
- ]
465
- GH_AW_SAFE_OUTPUTS_TOOLS_EOF
466
- cat > /opt/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_EOF'
467
- {
468
- "create_pull_request": {
469
- "defaultMax": 1,
470
- "fields": {
471
- "body": {
472
- "required": true,
473
- "type": "string",
474
- "sanitize": true,
475
- "maxLength": 65000
476
- },
477
- "branch": {
478
- "required": true,
479
- "type": "string",
480
- "sanitize": true,
481
- "maxLength": 256
482
- },
483
- "draft": {
484
- "type": "boolean"
485
- },
486
- "labels": {
487
- "type": "array",
488
- "itemType": "string",
489
- "itemSanitize": true,
490
- "itemMaxLength": 128
491
- },
492
- "repo": {
493
- "type": "string",
494
- "maxLength": 256
495
- },
496
- "title": {
497
- "required": true,
498
- "type": "string",
499
- "sanitize": true,
500
- "maxLength": 128
501
- }
502
- }
503
- },
504
- "missing_data": {
505
- "defaultMax": 20,
506
- "fields": {
507
- "alternatives": {
508
- "type": "string",
509
- "sanitize": true,
510
- "maxLength": 256
511
- },
512
- "context": {
513
- "type": "string",
514
- "sanitize": true,
515
- "maxLength": 256
516
- },
517
- "data_type": {
518
- "type": "string",
519
- "sanitize": true,
520
- "maxLength": 128
521
- },
522
- "reason": {
523
- "type": "string",
524
- "sanitize": true,
525
- "maxLength": 256
526
- }
527
- }
528
- },
529
- "missing_tool": {
530
- "defaultMax": 20,
531
- "fields": {
532
- "alternatives": {
533
- "type": "string",
534
- "sanitize": true,
535
- "maxLength": 512
536
- },
537
- "reason": {
538
- "required": true,
539
- "type": "string",
540
- "sanitize": true,
541
- "maxLength": 256
542
- },
543
- "tool": {
544
- "type": "string",
545
- "sanitize": true,
546
- "maxLength": 128
547
- }
548
- }
549
- },
550
- "noop": {
551
- "defaultMax": 1,
552
- "fields": {
553
- "message": {
554
- "required": true,
555
- "type": "string",
556
- "sanitize": true,
557
- "maxLength": 65000
558
- }
559
- }
560
- }
561
- }
562
- GH_AW_SAFE_OUTPUTS_VALIDATION_EOF
563
- - name: Generate Safe Outputs MCP Server Config
564
- id: safe-outputs-config
565
- run: |
566
- # Generate a secure random API key (360 bits of entropy, 40+ chars)
567
- # Mask immediately to prevent timing vulnerabilities
568
- API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
569
- echo "::add-mask::${API_KEY}"
570
-
571
- PORT=3001
572
-
573
- # Set outputs for next steps
574
- {
575
- echo "safe_outputs_api_key=${API_KEY}"
576
- echo "safe_outputs_port=${PORT}"
577
- } >> "$GITHUB_OUTPUT"
578
-
579
- echo "Safe Outputs MCP server will run on port ${PORT}"
580
-
581
- - name: Start Safe Outputs MCP HTTP Server
582
- id: safe-outputs-start
583
- env:
584
- DEBUG: '*'
585
- GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }}
586
- GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }}
587
- GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /opt/gh-aw/safeoutputs/tools.json
588
- GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /opt/gh-aw/safeoutputs/config.json
589
- GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
590
- run: |
591
- # Environment variables are set above to prevent template injection
592
- export DEBUG
593
- export GH_AW_SAFE_OUTPUTS_PORT
594
- export GH_AW_SAFE_OUTPUTS_API_KEY
595
- export GH_AW_SAFE_OUTPUTS_TOOLS_PATH
596
- export GH_AW_SAFE_OUTPUTS_CONFIG_PATH
597
- export GH_AW_MCP_LOG_DIR
598
-
599
- bash /opt/gh-aw/actions/start_safe_outputs_server.sh
600
-
601
- - name: Start MCP Gateway
602
- id: start-mcp-gateway
603
- env:
604
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
605
- GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }}
606
- GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }}
607
- GITHUB_MCP_LOCKDOWN: ${{ steps.determine-automatic-lockdown.outputs.lockdown == 'true' && '1' || '0' }}
608
- GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
609
- run: |
610
- set -eo pipefail
611
- mkdir -p /tmp/gh-aw/mcp-config
612
-
613
- # Export gateway environment variables for MCP config and gateway script
614
- export MCP_GATEWAY_PORT="80"
615
- export MCP_GATEWAY_DOMAIN="host.docker.internal"
616
- MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
617
- echo "::add-mask::${MCP_GATEWAY_API_KEY}"
618
- export MCP_GATEWAY_API_KEY
619
- export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
620
- mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
621
- export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
622
- export DEBUG="*"
623
-
624
- export GH_AW_ENGINE="copilot"
625
- 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'
626
-
627
- mkdir -p /home/runner/.copilot
628
- cat << GH_AW_MCP_CONFIG_EOF | bash /opt/gh-aw/actions/start_mcp_gateway.sh
629
- {
630
- "mcpServers": {
631
- "github": {
632
- "type": "stdio",
633
- "container": "ghcr.io/github/github-mcp-server:v0.32.0",
634
- "env": {
635
- "GITHUB_LOCKDOWN_MODE": "$GITHUB_MCP_LOCKDOWN",
636
- "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}",
637
- "GITHUB_READ_ONLY": "1",
638
- "GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
639
- }
640
- },
641
- "safeoutputs": {
642
- "type": "http",
643
- "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT",
644
- "headers": {
645
- "Authorization": "\${GH_AW_SAFE_OUTPUTS_API_KEY}"
646
- }
647
- }
648
- },
649
- "gateway": {
650
- "port": $MCP_GATEWAY_PORT,
651
- "domain": "${MCP_GATEWAY_DOMAIN}",
652
- "apiKey": "${MCP_GATEWAY_API_KEY}",
653
- "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
654
- }
655
- }
656
- GH_AW_MCP_CONFIG_EOF
657
- - name: Download activation artifact
658
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
659
- with:
660
- name: activation
661
- path: /tmp/gh-aw
662
- - name: Clean git credentials
663
- run: bash /opt/gh-aw/actions/clean_git_credentials.sh
664
- - name: Execute GitHub Copilot CLI
665
- id: agentic_execution
666
- # Copilot CLI tool arguments (sorted):
667
- timeout-minutes: 30
668
- run: |
669
- set -o pipefail
670
- touch /tmp/gh-aw/agent-step-summary.md
671
- # shellcheck disable=SC1003
672
- 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 \
673
- -- /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
674
- env:
675
- COPILOT_AGENT_RUNNER_TYPE: STANDALONE
676
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
677
- COPILOT_MODEL: claude-opus-4-20250514
678
- GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json
679
- GH_AW_PHASE: agent
680
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
681
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
682
- GH_AW_VERSION: v0.57.2
683
- GITHUB_API_URL: ${{ github.api_url }}
684
- GITHUB_AW: true
685
- GITHUB_HEAD_REF: ${{ github.head_ref }}
686
- GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
687
- GITHUB_REF_NAME: ${{ github.ref_name }}
688
- GITHUB_SERVER_URL: ${{ github.server_url }}
689
- GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
690
- GITHUB_WORKSPACE: ${{ github.workspace }}
691
- GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
692
- GIT_AUTHOR_NAME: github-actions[bot]
693
- GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
694
- GIT_COMMITTER_NAME: github-actions[bot]
695
- XDG_CONFIG_HOME: /home/runner
696
- - name: Detect inference access error
697
- id: detect-inference-error
698
- if: always()
699
- continue-on-error: true
700
- run: bash /opt/gh-aw/actions/detect_inference_access_error.sh
701
- - name: Configure Git credentials
702
- env:
703
- REPO_NAME: ${{ github.repository }}
704
- SERVER_URL: ${{ github.server_url }}
705
- run: |
706
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
707
- git config --global user.name "github-actions[bot]"
708
- git config --global am.keepcr true
709
- # Re-authenticate git with GitHub token
710
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
711
- git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
712
- echo "Git configured with standard GitHub Actions identity"
713
- - name: Copy Copilot session state files to logs
714
- if: always()
715
- continue-on-error: true
716
- run: |
717
- # Copy Copilot session state files to logs folder for artifact collection
718
- # This ensures they are in /tmp/gh-aw/ where secret redaction can scan them
719
- SESSION_STATE_DIR="$HOME/.copilot/session-state"
720
- LOGS_DIR="/tmp/gh-aw/sandbox/agent/logs"
721
-
722
- if [ -d "$SESSION_STATE_DIR" ]; then
723
- echo "Copying Copilot session state files from $SESSION_STATE_DIR to $LOGS_DIR"
724
- mkdir -p "$LOGS_DIR"
725
- cp -v "$SESSION_STATE_DIR"/*.jsonl "$LOGS_DIR/" 2>/dev/null || true
726
- echo "Session state files copied successfully"
727
- else
728
- echo "No session-state directory found at $SESSION_STATE_DIR"
729
- fi
730
- - name: Stop MCP Gateway
731
- if: always()
732
- continue-on-error: true
733
- env:
734
- MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
735
- MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
736
- GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }}
737
- run: |
738
- bash /opt/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID"
739
- - name: Redact secrets in logs
740
- if: always()
741
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
742
- with:
743
- script: |
744
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
745
- setupGlobals(core, github, context, exec, io);
746
- const { main } = require('/opt/gh-aw/actions/redact_secrets.cjs');
747
- await main();
748
- env:
749
- GH_AW_SECRET_NAMES: 'COPILOT_GITHUB_TOKEN,GH_AW_GITHUB_MCP_SERVER_TOKEN,GH_AW_GITHUB_TOKEN,GITHUB_TOKEN'
750
- SECRET_COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
751
- SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
752
- SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
753
- SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
754
- - name: Append agent step summary
755
- if: always()
756
- run: bash /opt/gh-aw/actions/append_agent_step_summary.sh
757
- - name: Upload Safe Outputs
758
- if: always()
759
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
760
- with:
761
- name: safe-output
762
- path: ${{ env.GH_AW_SAFE_OUTPUTS }}
763
- if-no-files-found: warn
764
- - name: Ingest agent output
765
- id: collect_output
766
- if: always()
767
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
768
- env:
769
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
770
- 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'
771
- GITHUB_SERVER_URL: ${{ github.server_url }}
772
- GITHUB_API_URL: ${{ github.api_url }}
773
- with:
774
- script: |
775
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
776
- setupGlobals(core, github, context, exec, io);
777
- const { main } = require('/opt/gh-aw/actions/collect_ndjson_output.cjs');
778
- await main();
779
- - name: Upload sanitized agent output
780
- if: always() && env.GH_AW_AGENT_OUTPUT
781
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
782
- with:
783
- name: agent-output
784
- path: ${{ env.GH_AW_AGENT_OUTPUT }}
785
- if-no-files-found: warn
786
- - name: Upload engine output files
787
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
788
- with:
789
- name: agent_outputs
790
- path: |
791
- /tmp/gh-aw/sandbox/agent/logs/
792
- /tmp/gh-aw/redacted-urls.log
793
- if-no-files-found: ignore
794
- - name: Parse agent logs for step summary
795
- if: always()
796
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
797
- env:
798
- GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/
799
- with:
800
- script: |
801
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
802
- setupGlobals(core, github, context, exec, io);
803
- const { main } = require('/opt/gh-aw/actions/parse_copilot_log.cjs');
804
- await main();
805
- - name: Parse MCP Gateway logs for step summary
806
- if: always()
807
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
808
- with:
809
- script: |
810
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
811
- setupGlobals(core, github, context, exec, io);
812
- const { main } = require('/opt/gh-aw/actions/parse_mcp_gateway_log.cjs');
813
- await main();
814
- - name: Print firewall logs
815
- if: always()
816
- continue-on-error: true
817
- env:
818
- AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
819
- run: |
820
- # Fix permissions on firewall logs so they can be uploaded as artifacts
821
- # AWF runs with sudo, creating files owned by root
822
- sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true
823
- # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step)
824
- if command -v awf &> /dev/null; then
825
- awf logs summary | tee -a "$GITHUB_STEP_SUMMARY"
826
- else
827
- echo 'AWF binary not installed, skipping firewall log summary'
828
- fi
829
- - name: Upload agent artifacts
830
- if: always()
831
- continue-on-error: true
832
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
833
- with:
834
- name: agent-artifacts
835
- path: |
836
- /tmp/gh-aw/aw-prompts/prompt.txt
837
- /tmp/gh-aw/mcp-logs/
838
- /tmp/gh-aw/sandbox/firewall/logs/
839
- /tmp/gh-aw/agent-stdio.log
840
- /tmp/gh-aw/agent/
841
- /tmp/gh-aw/aw-*.patch
842
- if-no-files-found: ignore
843
- # --- Threat Detection (inline) ---
844
- - name: Check if detection needed
845
- id: detection_guard
846
- if: always()
847
- env:
848
- OUTPUT_TYPES: ${{ steps.collect_output.outputs.output_types }}
849
- HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }}
850
- run: |
851
- if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then
852
- echo "run_detection=true" >> "$GITHUB_OUTPUT"
853
- echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH"
854
- else
855
- echo "run_detection=false" >> "$GITHUB_OUTPUT"
856
- echo "Detection skipped: no agent outputs or patches to analyze"
857
- fi
858
- - name: Clear MCP configuration for detection
859
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
860
- run: |
861
- rm -f /tmp/gh-aw/mcp-config/mcp-servers.json
862
- rm -f /home/runner/.copilot/mcp-config.json
863
- rm -f "$GITHUB_WORKSPACE/.gemini/settings.json"
864
- - name: Prepare threat detection files
865
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
866
- run: |
867
- mkdir -p /tmp/gh-aw/threat-detection/aw-prompts
868
- cp /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt 2>/dev/null || true
869
- cp /tmp/gh-aw/agent_output.json /tmp/gh-aw/threat-detection/agent_output.json 2>/dev/null || true
870
- for f in /tmp/gh-aw/aw-*.patch; do
871
- [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
872
- done
873
- echo "Prepared threat detection files:"
874
- ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true
875
- - name: Setup threat detection
876
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
877
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
878
- env:
879
- WORKFLOW_NAME: 'Dependency Maintenance Agent'
880
- WORKFLOW_DESCRIPTION: 'Automated dependency maintenance — npm, Docker transitive deps, Alpine packages, and validation (no version bump)'
881
- HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }}
882
- with:
883
- script: |
884
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
885
- setupGlobals(core, github, context, exec, io);
886
- const { main } = require('/opt/gh-aw/actions/setup_threat_detection.cjs');
887
- await main();
888
- - name: Ensure threat-detection directory and log
889
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
890
- run: |
891
- mkdir -p /tmp/gh-aw/threat-detection
892
- touch /tmp/gh-aw/threat-detection/detection.log
893
- - name: Execute GitHub Copilot CLI
894
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
895
- id: detection_agentic_execution
896
- # Copilot CLI tool arguments (sorted):
897
- # --allow-tool shell(cat)
898
- # --allow-tool shell(grep)
899
- # --allow-tool shell(head)
900
- # --allow-tool shell(jq)
901
- # --allow-tool shell(ls)
902
- # --allow-tool shell(tail)
903
- # --allow-tool shell(wc)
904
- timeout-minutes: 20
905
- run: |
906
- set -o pipefail
907
- touch /tmp/gh-aw/agent-step-summary.md
908
- # shellcheck disable=SC1003
909
- 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 \
910
- -- /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
911
- env:
912
- COPILOT_AGENT_RUNNER_TYPE: STANDALONE
913
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
914
- COPILOT_MODEL: claude-opus-4-20250514
915
- GH_AW_PHASE: detection
916
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
917
- GH_AW_VERSION: v0.57.2
918
- GITHUB_API_URL: ${{ github.api_url }}
919
- GITHUB_AW: true
920
- GITHUB_HEAD_REF: ${{ github.head_ref }}
921
- GITHUB_REF_NAME: ${{ github.ref_name }}
922
- GITHUB_SERVER_URL: ${{ github.server_url }}
923
- GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
924
- GITHUB_WORKSPACE: ${{ github.workspace }}
925
- GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
926
- GIT_AUTHOR_NAME: github-actions[bot]
927
- GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
928
- GIT_COMMITTER_NAME: github-actions[bot]
929
- XDG_CONFIG_HOME: /home/runner
930
- - name: Parse threat detection results
931
- id: parse_detection_results
932
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
933
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
934
- with:
935
- script: |
936
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
937
- setupGlobals(core, github, context, exec, io);
938
- const { main } = require('/opt/gh-aw/actions/parse_threat_detection_results.cjs');
939
- await main();
940
- - name: Upload threat detection log
941
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
942
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
943
- with:
944
- name: threat-detection.log
945
- path: /tmp/gh-aw/threat-detection/detection.log
946
- if-no-files-found: ignore
947
- - name: Set detection conclusion
948
- id: detection_conclusion
949
- if: always()
950
- env:
951
- RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
952
- DETECTION_SUCCESS: ${{ steps.parse_detection_results.outputs.success }}
953
- run: |
954
- if [[ "$RUN_DETECTION" != "true" ]]; then
955
- echo "conclusion=skipped" >> "$GITHUB_OUTPUT"
956
- echo "success=true" >> "$GITHUB_OUTPUT"
957
- echo "Detection was not needed, marking as skipped"
958
- elif [[ "$DETECTION_SUCCESS" == "true" ]]; then
959
- echo "conclusion=success" >> "$GITHUB_OUTPUT"
960
- echo "success=true" >> "$GITHUB_OUTPUT"
961
- echo "Detection passed successfully"
962
- else
963
- echo "conclusion=failure" >> "$GITHUB_OUTPUT"
964
- echo "success=false" >> "$GITHUB_OUTPUT"
965
- echo "Detection found issues"
966
- fi
967
-
968
- conclusion:
969
- needs:
970
- - activation
971
- - agent
972
- - safe_outputs
973
- if: (always()) && (needs.agent.result != 'skipped')
974
- runs-on: ubuntu-slim
975
- permissions:
976
- contents: write
977
- issues: write
978
- pull-requests: write
979
- concurrency:
980
- group: 'gh-aw-conclusion-dependency-maintenance'
981
- cancel-in-progress: false
982
- outputs:
983
- noop_message: ${{ steps.noop.outputs.noop_message }}
984
- tools_reported: ${{ steps.missing_tool.outputs.tools_reported }}
985
- total_count: ${{ steps.missing_tool.outputs.total_count }}
986
- steps:
987
- - name: Setup Scripts
988
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
989
- with:
990
- destination: /opt/gh-aw/actions
991
- - name: Download agent output artifact
992
- id: download-agent-output
993
- continue-on-error: true
994
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
995
- with:
996
- name: agent-output
997
- path: /tmp/gh-aw/safeoutputs/
998
- - name: Setup agent output environment variable
999
- if: steps.download-agent-output.outcome == 'success'
1000
- run: |
1001
- mkdir -p /tmp/gh-aw/safeoutputs/
1002
- find "/tmp/gh-aw/safeoutputs/" -type f -print
1003
- echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
1004
- - name: Process No-Op Messages
1005
- id: noop
1006
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1007
- env:
1008
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1009
- GH_AW_NOOP_MAX: '1'
1010
- GH_AW_WORKFLOW_NAME: 'Dependency Maintenance Agent'
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/noop.cjs');
1017
- await main();
1018
- - name: Record Missing Tool
1019
- id: missing_tool
1020
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1021
- env:
1022
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1023
- GH_AW_WORKFLOW_NAME: 'Dependency Maintenance Agent'
1024
- with:
1025
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1026
- script: |
1027
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1028
- setupGlobals(core, github, context, exec, io);
1029
- const { main } = require('/opt/gh-aw/actions/missing_tool.cjs');
1030
- await main();
1031
- - name: Handle Agent Failure
1032
- id: handle_agent_failure
1033
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1034
- env:
1035
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1036
- GH_AW_WORKFLOW_NAME: 'Dependency Maintenance Agent'
1037
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1038
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
1039
- GH_AW_WORKFLOW_ID: 'dependency-maintenance'
1040
- GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
1041
- GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
1042
- GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }}
1043
- GH_AW_CODE_PUSH_FAILURE_ERRORS: ${{ needs.safe_outputs.outputs.code_push_failure_errors }}
1044
- GH_AW_CODE_PUSH_FAILURE_COUNT: ${{ needs.safe_outputs.outputs.code_push_failure_count }}
1045
- GH_AW_GROUP_REPORTS: 'false'
1046
- GH_AW_FAILURE_REPORT_AS_ISSUE: 'true'
1047
- GH_AW_TIMEOUT_MINUTES: '30'
1048
- with:
1049
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1050
- script: |
1051
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1052
- setupGlobals(core, github, context, exec, io);
1053
- const { main } = require('/opt/gh-aw/actions/handle_agent_failure.cjs');
1054
- await main();
1055
- - name: Handle No-Op Message
1056
- id: handle_noop_message
1057
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1058
- env:
1059
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1060
- GH_AW_WORKFLOW_NAME: 'Dependency Maintenance Agent'
1061
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1062
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
1063
- GH_AW_NOOP_MESSAGE: ${{ steps.noop.outputs.noop_message }}
1064
- GH_AW_NOOP_REPORT_AS_ISSUE: 'true'
1065
- with:
1066
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1067
- script: |
1068
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1069
- setupGlobals(core, github, context, exec, io);
1070
- const { main } = require('/opt/gh-aw/actions/handle_noop_message.cjs');
1071
- await main();
1072
- - name: Handle Create Pull Request Error
1073
- id: handle_create_pr_error
1074
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1075
- env:
1076
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1077
- GH_AW_WORKFLOW_NAME: 'Dependency Maintenance Agent'
1078
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1079
- with:
1080
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1081
- script: |
1082
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1083
- setupGlobals(core, github, context, exec, io);
1084
- const { main } = require('/opt/gh-aw/actions/handle_create_pr_error.cjs');
1085
- await main();
1086
-
1087
- safe_outputs:
1088
- needs:
1089
- - activation
1090
- - agent
1091
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (needs.agent.outputs.detection_success == 'true')
1092
- runs-on: ubuntu-slim
1093
- permissions:
1094
- contents: write
1095
- issues: write
1096
- pull-requests: write
1097
- timeout-minutes: 15
1098
- env:
1099
- GH_AW_CALLER_WORKFLOW_ID: '${{ github.repository }}/dependency-maintenance'
1100
- GH_AW_ENGINE_ID: 'copilot'
1101
- GH_AW_ENGINE_MODEL: 'claude-opus-4-20250514'
1102
- GH_AW_WORKFLOW_ID: 'dependency-maintenance'
1103
- GH_AW_WORKFLOW_NAME: 'Dependency Maintenance Agent'
1104
- outputs:
1105
- code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }}
1106
- code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }}
1107
- create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}
1108
- create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}
1109
- created_pr_number: ${{ steps.process_safe_outputs.outputs.created_pr_number }}
1110
- created_pr_url: ${{ steps.process_safe_outputs.outputs.created_pr_url }}
1111
- process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
1112
- process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
1113
- steps:
1114
- - name: Setup Scripts
1115
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
1116
- with:
1117
- destination: /opt/gh-aw/actions
1118
- - name: Download agent output artifact
1119
- id: download-agent-output
1120
- continue-on-error: true
1121
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
1122
- with:
1123
- name: agent-output
1124
- path: /tmp/gh-aw/safeoutputs/
1125
- - name: Setup agent output environment variable
1126
- if: steps.download-agent-output.outcome == 'success'
1127
- run: |
1128
- mkdir -p /tmp/gh-aw/safeoutputs/
1129
- find "/tmp/gh-aw/safeoutputs/" -type f -print
1130
- echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
1131
- - name: Download patch artifact
1132
- continue-on-error: true
1133
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
1134
- with:
1135
- name: agent-artifacts
1136
- path: /tmp/gh-aw/
1137
- - name: Checkout repository
1138
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
1139
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1140
- with:
1141
- ref: ${{ github.base_ref || github.event.pull_request.base.ref || github.ref_name || github.event.repository.default_branch }}
1142
- token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1143
- persist-credentials: false
1144
- fetch-depth: 1
1145
- - name: Configure Git credentials
1146
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_pull_request'))
1147
- env:
1148
- REPO_NAME: ${{ github.repository }}
1149
- SERVER_URL: ${{ github.server_url }}
1150
- GIT_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1151
- run: |
1152
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
1153
- git config --global user.name "github-actions[bot]"
1154
- git config --global am.keepcr true
1155
- # Re-authenticate git with GitHub token
1156
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
1157
- git remote set-url origin "https://x-access-token:${GIT_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
1158
- echo "Git configured with standard GitHub Actions identity"
1159
- - name: Process Safe Outputs
1160
- id: process_safe_outputs
1161
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1162
- env:
1163
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1164
- 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'
1165
- GITHUB_SERVER_URL: ${{ github.server_url }}
1166
- GITHUB_API_URL: ${{ github.api_url }}
1167
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: '{"create_pull_request":{"draft":false,"expires":336,"fallback_as_issue":true,"if_no_changes":"ignore","labels":["dependencies","automated"],"max":1,"max_patch_size":1024,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","AGENTS.md"],"protected_path_prefixes":[".github/",".agents/"],"reviewers":["neverinfamous"],"title_prefix":"[deps] "},"missing_data":{},"missing_tool":{}}'
1168
- GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }}
1169
- with:
1170
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1171
- script: |
1172
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1173
- setupGlobals(core, github, context, exec, io);
1174
- const { main } = require('/opt/gh-aw/actions/safe_output_handler_manager.cjs');
1175
- await main();
1176
- - name: Upload safe output items manifest
1177
- if: always()
1178
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
1179
- with:
1180
- name: safe-output-items
1181
- path: /tmp/safe-output-items.jsonl
1182
- if-no-files-found: warn