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,1142 +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
- # Audit README and DOCKER_README for consistency and accuracy on every code PR
25
- #
26
- # gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"94113c57ff629142333bd5cee0eddb0e02a94676b3a1ce9879ba02327a1d0d00","compiler_version":"v0.57.2","strict":true}
27
-
28
- name: 'Documentation Drift Detector'
29
- 'on':
30
- pull_request:
31
- paths:
32
- - src/**
33
- - package.json
34
- - Dockerfile
35
- - tsconfig*.json
36
- - scripts/**
37
- types:
38
- - opened
39
- - ready_for_review
40
-
41
- permissions: {}
42
-
43
- concurrency: docs-drift-detector
44
-
45
- run-name: 'Documentation Drift Detector'
46
-
47
- jobs:
48
- activation:
49
- needs: pre_activation
50
- if: >
51
- (needs.pre_activation.outputs.activated == 'true') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id))
52
- runs-on: ubuntu-slim
53
- permissions:
54
- contents: read
55
- outputs:
56
- body: ${{ steps.sanitized.outputs.body }}
57
- comment_id: ''
58
- comment_repo: ''
59
- model: ${{ steps.generate_aw_info.outputs.model }}
60
- secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }}
61
- text: ${{ steps.sanitized.outputs.text }}
62
- title: ${{ steps.sanitized.outputs.title }}
63
- steps:
64
- - name: Setup Scripts
65
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
66
- with:
67
- destination: /opt/gh-aw/actions
68
- - name: Generate agentic run info
69
- id: generate_aw_info
70
- env:
71
- GH_AW_INFO_ENGINE_ID: 'copilot'
72
- GH_AW_INFO_ENGINE_NAME: 'GitHub Copilot CLI'
73
- GH_AW_INFO_MODEL: 'claude-opus-4-20250514'
74
- GH_AW_INFO_VERSION: ''
75
- GH_AW_INFO_AGENT_VERSION: 'latest'
76
- GH_AW_INFO_CLI_VERSION: 'v0.57.2'
77
- GH_AW_INFO_WORKFLOW_NAME: 'Documentation Drift Detector'
78
- GH_AW_INFO_EXPERIMENTAL: 'false'
79
- GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: 'true'
80
- GH_AW_INFO_STAGED: 'false'
81
- GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]'
82
- GH_AW_INFO_FIREWALL_ENABLED: 'true'
83
- GH_AW_INFO_AWF_VERSION: 'v0.23.0'
84
- GH_AW_INFO_AWMG_VERSION: ''
85
- GH_AW_INFO_FIREWALL_TYPE: 'squid'
86
- GH_AW_COMPILED_STRICT: 'true'
87
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
88
- with:
89
- script: |
90
- const { main } = require('/opt/gh-aw/actions/generate_aw_info.cjs');
91
- await main(core, context);
92
- - name: Validate COPILOT_GITHUB_TOKEN secret
93
- id: validate-secret
94
- 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
95
- env:
96
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
97
- - name: Checkout .github and .agents folders
98
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
99
- with:
100
- persist-credentials: false
101
- sparse-checkout: |
102
- .github
103
- .agents
104
- sparse-checkout-cone-mode: true
105
- fetch-depth: 1
106
- - name: Check workflow file timestamps
107
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
108
- env:
109
- GH_AW_WORKFLOW_FILE: 'docs-drift-detector.lock.yml'
110
- with:
111
- script: |
112
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
113
- setupGlobals(core, github, context, exec, io);
114
- const { main } = require('/opt/gh-aw/actions/check_workflow_timestamp_api.cjs');
115
- await main();
116
- - name: Compute current body text
117
- id: sanitized
118
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
119
- with:
120
- script: |
121
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
122
- setupGlobals(core, github, context, exec, io);
123
- const { main } = require('/opt/gh-aw/actions/compute_text.cjs');
124
- await main();
125
- - name: Create prompt with built-in context
126
- env:
127
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
128
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
129
- GH_AW_GITHUB_ACTOR: ${{ github.actor }}
130
- GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
131
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
132
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
133
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
134
- GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
135
- GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
136
- GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
137
- run: |
138
- bash /opt/gh-aw/actions/create_prompt_first.sh
139
- {
140
- cat << 'GH_AW_PROMPT_EOF'
141
- <system>
142
- GH_AW_PROMPT_EOF
143
- cat "/opt/gh-aw/prompts/xpia.md"
144
- cat "/opt/gh-aw/prompts/temp_folder_prompt.md"
145
- cat "/opt/gh-aw/prompts/markdown.md"
146
- cat "/opt/gh-aw/prompts/safe_outputs_prompt.md"
147
- cat << 'GH_AW_PROMPT_EOF'
148
- <safe-output-tools>
149
- Tools: add_comment, missing_tool, missing_data, noop
150
- </safe-output-tools>
151
- <github-context>
152
- The following GitHub context information is available for this workflow:
153
- {{#if __GH_AW_GITHUB_ACTOR__ }}
154
- - **actor**: __GH_AW_GITHUB_ACTOR__
155
- {{/if}}
156
- {{#if __GH_AW_GITHUB_REPOSITORY__ }}
157
- - **repository**: __GH_AW_GITHUB_REPOSITORY__
158
- {{/if}}
159
- {{#if __GH_AW_GITHUB_WORKSPACE__ }}
160
- - **workspace**: __GH_AW_GITHUB_WORKSPACE__
161
- {{/if}}
162
- {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }}
163
- - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__
164
- {{/if}}
165
- {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }}
166
- - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__
167
- {{/if}}
168
- {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }}
169
- - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__
170
- {{/if}}
171
- {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }}
172
- - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__
173
- {{/if}}
174
- {{#if __GH_AW_GITHUB_RUN_ID__ }}
175
- - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__
176
- {{/if}}
177
- </github-context>
178
-
179
- GH_AW_PROMPT_EOF
180
- cat << 'GH_AW_PROMPT_EOF'
181
- </system>
182
- GH_AW_PROMPT_EOF
183
- cat << 'GH_AW_PROMPT_EOF'
184
- {{#runtime-import .github/workflows/docs-drift-detector.md}}
185
- GH_AW_PROMPT_EOF
186
- } > "$GH_AW_PROMPT"
187
- - name: Interpolate variables and render templates
188
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
189
- env:
190
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
191
- with:
192
- script: |
193
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
194
- setupGlobals(core, github, context, exec, io);
195
- const { main } = require('/opt/gh-aw/actions/interpolate_prompt.cjs');
196
- await main();
197
- - name: Substitute placeholders
198
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
199
- env:
200
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
201
- GH_AW_GITHUB_ACTOR: ${{ github.actor }}
202
- GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
203
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
204
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
205
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
206
- GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
207
- GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
208
- GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
209
- GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: ${{ needs.pre_activation.outputs.activated }}
210
- with:
211
- script: |
212
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
213
- setupGlobals(core, github, context, exec, io);
214
-
215
- const substitutePlaceholders = require('/opt/gh-aw/actions/substitute_placeholders.cjs');
216
-
217
- // Call the substitution function
218
- return await substitutePlaceholders({
219
- file: process.env.GH_AW_PROMPT,
220
- substitutions: {
221
- GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR,
222
- GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID,
223
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER,
224
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER,
225
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER,
226
- GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY,
227
- GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID,
228
- GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE,
229
- GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED
230
- }
231
- });
232
- - name: Validate prompt placeholders
233
- env:
234
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
235
- run: bash /opt/gh-aw/actions/validate_prompt_placeholders.sh
236
- - name: Print prompt
237
- env:
238
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
239
- run: bash /opt/gh-aw/actions/print_prompt_summary.sh
240
- - name: Upload activation artifact
241
- if: success()
242
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
243
- with:
244
- name: activation
245
- path: |
246
- /tmp/gh-aw/aw_info.json
247
- /tmp/gh-aw/aw-prompts/prompt.txt
248
- retention-days: 1
249
-
250
- agent:
251
- needs: activation
252
- runs-on: ubuntu-latest
253
- permissions: read-all
254
- env:
255
- DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
256
- GH_AW_ASSETS_ALLOWED_EXTS: ''
257
- GH_AW_ASSETS_BRANCH: ''
258
- GH_AW_ASSETS_MAX_SIZE_KB: 0
259
- GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
260
- GH_AW_SAFE_OUTPUTS: /opt/gh-aw/safeoutputs/outputs.jsonl
261
- GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /opt/gh-aw/safeoutputs/config.json
262
- GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /opt/gh-aw/safeoutputs/tools.json
263
- GH_AW_WORKFLOW_ID_SANITIZED: docsdriftdetector
264
- outputs:
265
- checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }}
266
- detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }}
267
- detection_success: ${{ steps.detection_conclusion.outputs.success }}
268
- has_patch: ${{ steps.collect_output.outputs.has_patch }}
269
- inference_access_error: ${{ steps.detect-inference-error.outputs.inference_access_error || 'false' }}
270
- model: ${{ needs.activation.outputs.model }}
271
- output: ${{ steps.collect_output.outputs.output }}
272
- output_types: ${{ steps.collect_output.outputs.output_types }}
273
- steps:
274
- - name: Setup Scripts
275
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
276
- with:
277
- destination: /opt/gh-aw/actions
278
- - name: Checkout repository
279
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
280
- with:
281
- persist-credentials: false
282
- - name: Create gh-aw temp directory
283
- run: bash /opt/gh-aw/actions/create_gh_aw_tmp_dir.sh
284
- - name: Configure Git credentials
285
- env:
286
- REPO_NAME: ${{ github.repository }}
287
- SERVER_URL: ${{ github.server_url }}
288
- run: |
289
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
290
- git config --global user.name "github-actions[bot]"
291
- git config --global am.keepcr true
292
- # Re-authenticate git with GitHub token
293
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
294
- git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
295
- echo "Git configured with standard GitHub Actions identity"
296
- - name: Checkout PR branch
297
- id: checkout-pr
298
- if: |
299
- (github.event.pull_request) || (github.event.issue.pull_request)
300
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
301
- env:
302
- GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
303
- with:
304
- github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
305
- script: |
306
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
307
- setupGlobals(core, github, context, exec, io);
308
- const { main } = require('/opt/gh-aw/actions/checkout_pr_branch.cjs');
309
- await main();
310
- - name: Install GitHub Copilot CLI
311
- run: /opt/gh-aw/actions/install_copilot_cli.sh latest
312
- - name: Install awf binary
313
- run: bash /opt/gh-aw/actions/install_awf_binary.sh v0.23.0
314
- - name: Determine automatic lockdown mode for GitHub MCP Server
315
- id: determine-automatic-lockdown
316
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
317
- env:
318
- GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
319
- GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
320
- with:
321
- script: |
322
- const determineAutomaticLockdown = require('/opt/gh-aw/actions/determine_automatic_lockdown.cjs');
323
- await determineAutomaticLockdown(github, context, core);
324
- - name: Download container images
325
- 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
326
- - name: Write Safe Outputs Config
327
- run: |
328
- mkdir -p /opt/gh-aw/safeoutputs
329
- mkdir -p /tmp/gh-aw/safeoutputs
330
- mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
331
- cat > /opt/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_EOF'
332
- {"add_comment":{"max":3},"missing_data":{},"missing_tool":{},"noop":{"max":1}}
333
- GH_AW_SAFE_OUTPUTS_CONFIG_EOF
334
- cat > /opt/gh-aw/safeoutputs/tools.json << 'GH_AW_SAFE_OUTPUTS_TOOLS_EOF'
335
- [
336
- {
337
- "description": "Add a comment to an existing GitHub issue, pull request, or discussion. Use this to provide feedback, answer questions, or add information to an existing conversation. For creating new items, use create_issue, create_discussion, or create_pull_request instead. IMPORTANT: Comments are subject to validation constraints enforced by the MCP server - maximum 65536 characters for the complete comment (including footer which is added automatically), 10 mentions (@username), and 50 links. Exceeding these limits will result in an immediate error with specific guidance. NOTE: By default, this tool requires discussions:write permission. If your GitHub App lacks Discussions permission, set 'discussions: false' in the workflow's safe-outputs.add-comment configuration to exclude this permission. CONSTRAINTS: Maximum 3 comment(s) can be added.",
338
- "inputSchema": {
339
- "additionalProperties": false,
340
- "properties": {
341
- "body": {
342
- "description": "The comment text in Markdown format. This is the 'body' field - do not use 'comment_body' or other variations. Provide helpful, relevant information that adds value to the conversation. CONSTRAINTS: The complete comment (your body text + automatically added footer) must not exceed 65536 characters total. Maximum 10 mentions (@username), maximum 50 links (http/https URLs). A footer (~200-500 characters) is automatically appended with workflow attribution, so leave adequate space. If these limits are exceeded, the tool call will fail with a detailed error message indicating which constraint was violated.",
343
- "type": "string"
344
- },
345
- "integrity": {
346
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
347
- "type": "string"
348
- },
349
- "item_number": {
350
- "description": "The issue, pull request, or discussion number to comment on. This is the numeric ID from the GitHub URL (e.g., 123 in github.com/owner/repo/issues/123). Can also be a temporary_id (e.g., 'aw_abc123') from a previously created issue in the same workflow run. If omitted, the tool auto-targets the issue, PR, or discussion that triggered this workflow. Auto-targeting only works for issue, pull_request, discussion, and comment event triggers — it does NOT work for schedule, workflow_dispatch, push, or workflow_run triggers. For those trigger types, always provide item_number explicitly, or the tool call will fail with an error.",
351
- "type": [
352
- "number",
353
- "string"
354
- ]
355
- },
356
- "secrecy": {
357
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
358
- "type": "string"
359
- },
360
- "temporary_id": {
361
- "description": "Unique temporary identifier for this comment. Format: 'aw_' followed by 3 to 12 alphanumeric characters (e.g., 'aw_abc1', 'aw_Test123'). Auto-generated if not provided. The temporary ID is returned in the tool response so you can reference this comment later.",
362
- "pattern": "^aw_[A-Za-z0-9]{3,12}$",
363
- "type": "string"
364
- }
365
- },
366
- "required": [
367
- "body"
368
- ],
369
- "type": "object"
370
- },
371
- "name": "add_comment"
372
- },
373
- {
374
- "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.",
375
- "inputSchema": {
376
- "additionalProperties": false,
377
- "properties": {
378
- "alternatives": {
379
- "description": "Any workarounds, manual steps, or alternative approaches the user could take (max 256 characters).",
380
- "type": "string"
381
- },
382
- "integrity": {
383
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
384
- "type": "string"
385
- },
386
- "reason": {
387
- "description": "Explanation of why this tool is needed or what information you want to share about the limitation (max 256 characters).",
388
- "type": "string"
389
- },
390
- "secrecy": {
391
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
392
- "type": "string"
393
- },
394
- "tool": {
395
- "description": "Optional: Name or description of the missing tool or capability (max 128 characters). Be specific about what functionality is needed.",
396
- "type": "string"
397
- }
398
- },
399
- "required": [
400
- "reason"
401
- ],
402
- "type": "object"
403
- },
404
- "name": "missing_tool"
405
- },
406
- {
407
- "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.",
408
- "inputSchema": {
409
- "additionalProperties": false,
410
- "properties": {
411
- "integrity": {
412
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
413
- "type": "string"
414
- },
415
- "message": {
416
- "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').",
417
- "type": "string"
418
- },
419
- "secrecy": {
420
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
421
- "type": "string"
422
- }
423
- },
424
- "required": [
425
- "message"
426
- ],
427
- "type": "object"
428
- },
429
- "name": "noop"
430
- },
431
- {
432
- "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.",
433
- "inputSchema": {
434
- "additionalProperties": false,
435
- "properties": {
436
- "alternatives": {
437
- "description": "Any workarounds, manual steps, or alternative approaches the user could take (max 256 characters).",
438
- "type": "string"
439
- },
440
- "context": {
441
- "description": "Additional context about the missing data or where it should come from (max 256 characters).",
442
- "type": "string"
443
- },
444
- "data_type": {
445
- "description": "Type or description of the missing data or information (max 128 characters). Be specific about what data is needed.",
446
- "type": "string"
447
- },
448
- "integrity": {
449
- "description": "Trustworthiness level of the message source (e.g., \"low\", \"medium\", \"high\").",
450
- "type": "string"
451
- },
452
- "reason": {
453
- "description": "Explanation of why this data is needed to complete the task (max 256 characters).",
454
- "type": "string"
455
- },
456
- "secrecy": {
457
- "description": "Confidentiality level of the message content (e.g., \"public\", \"internal\", \"private\").",
458
- "type": "string"
459
- }
460
- },
461
- "required": [],
462
- "type": "object"
463
- },
464
- "name": "missing_data"
465
- }
466
- ]
467
- GH_AW_SAFE_OUTPUTS_TOOLS_EOF
468
- cat > /opt/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_EOF'
469
- {
470
- "add_comment": {
471
- "defaultMax": 1,
472
- "fields": {
473
- "body": {
474
- "required": true,
475
- "type": "string",
476
- "sanitize": true,
477
- "maxLength": 65000
478
- },
479
- "item_number": {
480
- "issueOrPRNumber": true
481
- },
482
- "repo": {
483
- "type": "string",
484
- "maxLength": 256
485
- }
486
- }
487
- },
488
- "missing_data": {
489
- "defaultMax": 20,
490
- "fields": {
491
- "alternatives": {
492
- "type": "string",
493
- "sanitize": true,
494
- "maxLength": 256
495
- },
496
- "context": {
497
- "type": "string",
498
- "sanitize": true,
499
- "maxLength": 256
500
- },
501
- "data_type": {
502
- "type": "string",
503
- "sanitize": true,
504
- "maxLength": 128
505
- },
506
- "reason": {
507
- "type": "string",
508
- "sanitize": true,
509
- "maxLength": 256
510
- }
511
- }
512
- },
513
- "missing_tool": {
514
- "defaultMax": 20,
515
- "fields": {
516
- "alternatives": {
517
- "type": "string",
518
- "sanitize": true,
519
- "maxLength": 512
520
- },
521
- "reason": {
522
- "required": true,
523
- "type": "string",
524
- "sanitize": true,
525
- "maxLength": 256
526
- },
527
- "tool": {
528
- "type": "string",
529
- "sanitize": true,
530
- "maxLength": 128
531
- }
532
- }
533
- },
534
- "noop": {
535
- "defaultMax": 1,
536
- "fields": {
537
- "message": {
538
- "required": true,
539
- "type": "string",
540
- "sanitize": true,
541
- "maxLength": 65000
542
- }
543
- }
544
- }
545
- }
546
- GH_AW_SAFE_OUTPUTS_VALIDATION_EOF
547
- - name: Generate Safe Outputs MCP Server Config
548
- id: safe-outputs-config
549
- run: |
550
- # Generate a secure random API key (360 bits of entropy, 40+ chars)
551
- # Mask immediately to prevent timing vulnerabilities
552
- API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
553
- echo "::add-mask::${API_KEY}"
554
-
555
- PORT=3001
556
-
557
- # Set outputs for next steps
558
- {
559
- echo "safe_outputs_api_key=${API_KEY}"
560
- echo "safe_outputs_port=${PORT}"
561
- } >> "$GITHUB_OUTPUT"
562
-
563
- echo "Safe Outputs MCP server will run on port ${PORT}"
564
-
565
- - name: Start Safe Outputs MCP HTTP Server
566
- id: safe-outputs-start
567
- env:
568
- DEBUG: '*'
569
- GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }}
570
- GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }}
571
- GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /opt/gh-aw/safeoutputs/tools.json
572
- GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /opt/gh-aw/safeoutputs/config.json
573
- GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
574
- run: |
575
- # Environment variables are set above to prevent template injection
576
- export DEBUG
577
- export GH_AW_SAFE_OUTPUTS_PORT
578
- export GH_AW_SAFE_OUTPUTS_API_KEY
579
- export GH_AW_SAFE_OUTPUTS_TOOLS_PATH
580
- export GH_AW_SAFE_OUTPUTS_CONFIG_PATH
581
- export GH_AW_MCP_LOG_DIR
582
-
583
- bash /opt/gh-aw/actions/start_safe_outputs_server.sh
584
-
585
- - name: Start MCP Gateway
586
- id: start-mcp-gateway
587
- env:
588
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
589
- GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }}
590
- GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }}
591
- GITHUB_MCP_LOCKDOWN: ${{ steps.determine-automatic-lockdown.outputs.lockdown == 'true' && '1' || '0' }}
592
- GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
593
- run: |
594
- set -eo pipefail
595
- mkdir -p /tmp/gh-aw/mcp-config
596
-
597
- # Export gateway environment variables for MCP config and gateway script
598
- export MCP_GATEWAY_PORT="80"
599
- export MCP_GATEWAY_DOMAIN="host.docker.internal"
600
- MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
601
- echo "::add-mask::${MCP_GATEWAY_API_KEY}"
602
- export MCP_GATEWAY_API_KEY
603
- export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
604
- mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
605
- export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288"
606
- export DEBUG="*"
607
-
608
- export GH_AW_ENGINE="copilot"
609
- 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'
610
-
611
- mkdir -p /home/runner/.copilot
612
- cat << GH_AW_MCP_CONFIG_EOF | bash /opt/gh-aw/actions/start_mcp_gateway.sh
613
- {
614
- "mcpServers": {
615
- "github": {
616
- "type": "stdio",
617
- "container": "ghcr.io/github/github-mcp-server:v0.32.0",
618
- "env": {
619
- "GITHUB_LOCKDOWN_MODE": "$GITHUB_MCP_LOCKDOWN",
620
- "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}",
621
- "GITHUB_READ_ONLY": "1",
622
- "GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
623
- }
624
- },
625
- "safeoutputs": {
626
- "type": "http",
627
- "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT",
628
- "headers": {
629
- "Authorization": "\${GH_AW_SAFE_OUTPUTS_API_KEY}"
630
- }
631
- }
632
- },
633
- "gateway": {
634
- "port": $MCP_GATEWAY_PORT,
635
- "domain": "${MCP_GATEWAY_DOMAIN}",
636
- "apiKey": "${MCP_GATEWAY_API_KEY}",
637
- "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
638
- }
639
- }
640
- GH_AW_MCP_CONFIG_EOF
641
- - name: Download activation artifact
642
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
643
- with:
644
- name: activation
645
- path: /tmp/gh-aw
646
- - name: Clean git credentials
647
- run: bash /opt/gh-aw/actions/clean_git_credentials.sh
648
- - name: Execute GitHub Copilot CLI
649
- id: agentic_execution
650
- # Copilot CLI tool arguments (sorted):
651
- timeout-minutes: 15
652
- run: |
653
- set -o pipefail
654
- touch /tmp/gh-aw/agent-step-summary.md
655
- # shellcheck disable=SC1003
656
- 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,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.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 \
657
- -- /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
658
- env:
659
- COPILOT_AGENT_RUNNER_TYPE: STANDALONE
660
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
661
- COPILOT_MODEL: claude-opus-4-20250514
662
- GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json
663
- GH_AW_PHASE: agent
664
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
665
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
666
- GH_AW_VERSION: v0.57.2
667
- GITHUB_API_URL: ${{ github.api_url }}
668
- GITHUB_AW: true
669
- GITHUB_HEAD_REF: ${{ github.head_ref }}
670
- GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
671
- GITHUB_REF_NAME: ${{ github.ref_name }}
672
- GITHUB_SERVER_URL: ${{ github.server_url }}
673
- GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
674
- GITHUB_WORKSPACE: ${{ github.workspace }}
675
- GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
676
- GIT_AUTHOR_NAME: github-actions[bot]
677
- GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
678
- GIT_COMMITTER_NAME: github-actions[bot]
679
- XDG_CONFIG_HOME: /home/runner
680
- - name: Detect inference access error
681
- id: detect-inference-error
682
- if: always()
683
- continue-on-error: true
684
- run: bash /opt/gh-aw/actions/detect_inference_access_error.sh
685
- - name: Configure Git credentials
686
- env:
687
- REPO_NAME: ${{ github.repository }}
688
- SERVER_URL: ${{ github.server_url }}
689
- run: |
690
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
691
- git config --global user.name "github-actions[bot]"
692
- git config --global am.keepcr true
693
- # Re-authenticate git with GitHub token
694
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
695
- git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
696
- echo "Git configured with standard GitHub Actions identity"
697
- - name: Copy Copilot session state files to logs
698
- if: always()
699
- continue-on-error: true
700
- run: |
701
- # Copy Copilot session state files to logs folder for artifact collection
702
- # This ensures they are in /tmp/gh-aw/ where secret redaction can scan them
703
- SESSION_STATE_DIR="$HOME/.copilot/session-state"
704
- LOGS_DIR="/tmp/gh-aw/sandbox/agent/logs"
705
-
706
- if [ -d "$SESSION_STATE_DIR" ]; then
707
- echo "Copying Copilot session state files from $SESSION_STATE_DIR to $LOGS_DIR"
708
- mkdir -p "$LOGS_DIR"
709
- cp -v "$SESSION_STATE_DIR"/*.jsonl "$LOGS_DIR/" 2>/dev/null || true
710
- echo "Session state files copied successfully"
711
- else
712
- echo "No session-state directory found at $SESSION_STATE_DIR"
713
- fi
714
- - name: Stop MCP Gateway
715
- if: always()
716
- continue-on-error: true
717
- env:
718
- MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
719
- MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
720
- GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }}
721
- run: |
722
- bash /opt/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID"
723
- - name: Redact secrets in logs
724
- if: always()
725
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
726
- with:
727
- script: |
728
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
729
- setupGlobals(core, github, context, exec, io);
730
- const { main } = require('/opt/gh-aw/actions/redact_secrets.cjs');
731
- await main();
732
- env:
733
- GH_AW_SECRET_NAMES: 'COPILOT_GITHUB_TOKEN,GH_AW_GITHUB_MCP_SERVER_TOKEN,GH_AW_GITHUB_TOKEN,GITHUB_TOKEN'
734
- SECRET_COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
735
- SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
736
- SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
737
- SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
738
- - name: Append agent step summary
739
- if: always()
740
- run: bash /opt/gh-aw/actions/append_agent_step_summary.sh
741
- - name: Upload Safe Outputs
742
- if: always()
743
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
744
- with:
745
- name: safe-output
746
- path: ${{ env.GH_AW_SAFE_OUTPUTS }}
747
- if-no-files-found: warn
748
- - name: Ingest agent output
749
- id: collect_output
750
- if: always()
751
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
752
- env:
753
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
754
- GH_AW_ALLOWED_DOMAINS: 'api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com'
755
- GITHUB_SERVER_URL: ${{ github.server_url }}
756
- GITHUB_API_URL: ${{ github.api_url }}
757
- with:
758
- script: |
759
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
760
- setupGlobals(core, github, context, exec, io);
761
- const { main } = require('/opt/gh-aw/actions/collect_ndjson_output.cjs');
762
- await main();
763
- - name: Upload sanitized agent output
764
- if: always() && env.GH_AW_AGENT_OUTPUT
765
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
766
- with:
767
- name: agent-output
768
- path: ${{ env.GH_AW_AGENT_OUTPUT }}
769
- if-no-files-found: warn
770
- - name: Upload engine output files
771
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
772
- with:
773
- name: agent_outputs
774
- path: |
775
- /tmp/gh-aw/sandbox/agent/logs/
776
- /tmp/gh-aw/redacted-urls.log
777
- if-no-files-found: ignore
778
- - name: Parse agent logs for step summary
779
- if: always()
780
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
781
- env:
782
- GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/
783
- with:
784
- script: |
785
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
786
- setupGlobals(core, github, context, exec, io);
787
- const { main } = require('/opt/gh-aw/actions/parse_copilot_log.cjs');
788
- await main();
789
- - name: Parse MCP Gateway logs for step summary
790
- if: always()
791
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
792
- with:
793
- script: |
794
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
795
- setupGlobals(core, github, context, exec, io);
796
- const { main } = require('/opt/gh-aw/actions/parse_mcp_gateway_log.cjs');
797
- await main();
798
- - name: Print firewall logs
799
- if: always()
800
- continue-on-error: true
801
- env:
802
- AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
803
- run: |
804
- # Fix permissions on firewall logs so they can be uploaded as artifacts
805
- # AWF runs with sudo, creating files owned by root
806
- sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true
807
- # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step)
808
- if command -v awf &> /dev/null; then
809
- awf logs summary | tee -a "$GITHUB_STEP_SUMMARY"
810
- else
811
- echo 'AWF binary not installed, skipping firewall log summary'
812
- fi
813
- - name: Upload agent artifacts
814
- if: always()
815
- continue-on-error: true
816
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
817
- with:
818
- name: agent-artifacts
819
- path: |
820
- /tmp/gh-aw/aw-prompts/prompt.txt
821
- /tmp/gh-aw/mcp-logs/
822
- /tmp/gh-aw/sandbox/firewall/logs/
823
- /tmp/gh-aw/agent-stdio.log
824
- /tmp/gh-aw/agent/
825
- if-no-files-found: ignore
826
- # --- Threat Detection (inline) ---
827
- - name: Check if detection needed
828
- id: detection_guard
829
- if: always()
830
- env:
831
- OUTPUT_TYPES: ${{ steps.collect_output.outputs.output_types }}
832
- HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }}
833
- run: |
834
- if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then
835
- echo "run_detection=true" >> "$GITHUB_OUTPUT"
836
- echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH"
837
- else
838
- echo "run_detection=false" >> "$GITHUB_OUTPUT"
839
- echo "Detection skipped: no agent outputs or patches to analyze"
840
- fi
841
- - name: Clear MCP configuration for detection
842
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
843
- run: |
844
- rm -f /tmp/gh-aw/mcp-config/mcp-servers.json
845
- rm -f /home/runner/.copilot/mcp-config.json
846
- rm -f "$GITHUB_WORKSPACE/.gemini/settings.json"
847
- - name: Prepare threat detection files
848
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
849
- run: |
850
- mkdir -p /tmp/gh-aw/threat-detection/aw-prompts
851
- cp /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt 2>/dev/null || true
852
- cp /tmp/gh-aw/agent_output.json /tmp/gh-aw/threat-detection/agent_output.json 2>/dev/null || true
853
- for f in /tmp/gh-aw/aw-*.patch; do
854
- [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true
855
- done
856
- echo "Prepared threat detection files:"
857
- ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true
858
- - name: Setup threat detection
859
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
860
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
861
- env:
862
- WORKFLOW_NAME: 'Documentation Drift Detector'
863
- WORKFLOW_DESCRIPTION: 'Audit README and DOCKER_README for consistency and accuracy on every code PR'
864
- HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }}
865
- with:
866
- script: |
867
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
868
- setupGlobals(core, github, context, exec, io);
869
- const { main } = require('/opt/gh-aw/actions/setup_threat_detection.cjs');
870
- await main();
871
- - name: Ensure threat-detection directory and log
872
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
873
- run: |
874
- mkdir -p /tmp/gh-aw/threat-detection
875
- touch /tmp/gh-aw/threat-detection/detection.log
876
- - name: Execute GitHub Copilot CLI
877
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
878
- id: detection_agentic_execution
879
- # Copilot CLI tool arguments (sorted):
880
- # --allow-tool shell(cat)
881
- # --allow-tool shell(grep)
882
- # --allow-tool shell(head)
883
- # --allow-tool shell(jq)
884
- # --allow-tool shell(ls)
885
- # --allow-tool shell(tail)
886
- # --allow-tool shell(wc)
887
- timeout-minutes: 20
888
- run: |
889
- set -o pipefail
890
- touch /tmp/gh-aw/agent-step-summary.md
891
- # shellcheck disable=SC1003
892
- 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 \
893
- -- /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
894
- env:
895
- COPILOT_AGENT_RUNNER_TYPE: STANDALONE
896
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
897
- COPILOT_MODEL: claude-opus-4-20250514
898
- GH_AW_PHASE: detection
899
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
900
- GH_AW_VERSION: v0.57.2
901
- GITHUB_API_URL: ${{ github.api_url }}
902
- GITHUB_AW: true
903
- GITHUB_HEAD_REF: ${{ github.head_ref }}
904
- GITHUB_REF_NAME: ${{ github.ref_name }}
905
- GITHUB_SERVER_URL: ${{ github.server_url }}
906
- GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md
907
- GITHUB_WORKSPACE: ${{ github.workspace }}
908
- GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
909
- GIT_AUTHOR_NAME: github-actions[bot]
910
- GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
911
- GIT_COMMITTER_NAME: github-actions[bot]
912
- XDG_CONFIG_HOME: /home/runner
913
- - name: Parse threat detection results
914
- id: parse_detection_results
915
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
916
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
917
- with:
918
- script: |
919
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
920
- setupGlobals(core, github, context, exec, io);
921
- const { main } = require('/opt/gh-aw/actions/parse_threat_detection_results.cjs');
922
- await main();
923
- - name: Upload threat detection log
924
- if: always() && steps.detection_guard.outputs.run_detection == 'true'
925
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
926
- with:
927
- name: threat-detection.log
928
- path: /tmp/gh-aw/threat-detection/detection.log
929
- if-no-files-found: ignore
930
- - name: Set detection conclusion
931
- id: detection_conclusion
932
- if: always()
933
- env:
934
- RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
935
- DETECTION_SUCCESS: ${{ steps.parse_detection_results.outputs.success }}
936
- run: |
937
- if [[ "$RUN_DETECTION" != "true" ]]; then
938
- echo "conclusion=skipped" >> "$GITHUB_OUTPUT"
939
- echo "success=true" >> "$GITHUB_OUTPUT"
940
- echo "Detection was not needed, marking as skipped"
941
- elif [[ "$DETECTION_SUCCESS" == "true" ]]; then
942
- echo "conclusion=success" >> "$GITHUB_OUTPUT"
943
- echo "success=true" >> "$GITHUB_OUTPUT"
944
- echo "Detection passed successfully"
945
- else
946
- echo "conclusion=failure" >> "$GITHUB_OUTPUT"
947
- echo "success=false" >> "$GITHUB_OUTPUT"
948
- echo "Detection found issues"
949
- fi
950
-
951
- conclusion:
952
- needs:
953
- - activation
954
- - agent
955
- - safe_outputs
956
- if: (always()) && (needs.agent.result != 'skipped')
957
- runs-on: ubuntu-slim
958
- permissions:
959
- contents: read
960
- issues: write
961
- pull-requests: write
962
- concurrency:
963
- group: 'gh-aw-conclusion-docs-drift-detector'
964
- cancel-in-progress: false
965
- outputs:
966
- noop_message: ${{ steps.noop.outputs.noop_message }}
967
- tools_reported: ${{ steps.missing_tool.outputs.tools_reported }}
968
- total_count: ${{ steps.missing_tool.outputs.total_count }}
969
- steps:
970
- - name: Setup Scripts
971
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
972
- with:
973
- destination: /opt/gh-aw/actions
974
- - name: Download agent output artifact
975
- id: download-agent-output
976
- continue-on-error: true
977
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
978
- with:
979
- name: agent-output
980
- path: /tmp/gh-aw/safeoutputs/
981
- - name: Setup agent output environment variable
982
- if: steps.download-agent-output.outcome == 'success'
983
- run: |
984
- mkdir -p /tmp/gh-aw/safeoutputs/
985
- find "/tmp/gh-aw/safeoutputs/" -type f -print
986
- echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
987
- - name: Process No-Op Messages
988
- id: noop
989
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
990
- env:
991
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
992
- GH_AW_NOOP_MAX: '1'
993
- GH_AW_WORKFLOW_NAME: 'Documentation Drift Detector'
994
- with:
995
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
996
- script: |
997
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
998
- setupGlobals(core, github, context, exec, io);
999
- const { main } = require('/opt/gh-aw/actions/noop.cjs');
1000
- await main();
1001
- - name: Record Missing Tool
1002
- id: missing_tool
1003
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1004
- env:
1005
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1006
- GH_AW_WORKFLOW_NAME: 'Documentation Drift Detector'
1007
- with:
1008
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1009
- script: |
1010
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1011
- setupGlobals(core, github, context, exec, io);
1012
- const { main } = require('/opt/gh-aw/actions/missing_tool.cjs');
1013
- await main();
1014
- - name: Handle Agent Failure
1015
- id: handle_agent_failure
1016
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1017
- env:
1018
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1019
- GH_AW_WORKFLOW_NAME: 'Documentation Drift Detector'
1020
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1021
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
1022
- GH_AW_WORKFLOW_ID: 'docs-drift-detector'
1023
- GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
1024
- GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
1025
- GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }}
1026
- GH_AW_GROUP_REPORTS: 'false'
1027
- GH_AW_FAILURE_REPORT_AS_ISSUE: 'true'
1028
- GH_AW_TIMEOUT_MINUTES: '15'
1029
- with:
1030
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1031
- script: |
1032
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1033
- setupGlobals(core, github, context, exec, io);
1034
- const { main } = require('/opt/gh-aw/actions/handle_agent_failure.cjs');
1035
- await main();
1036
- - name: Handle No-Op Message
1037
- id: handle_noop_message
1038
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1039
- env:
1040
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1041
- GH_AW_WORKFLOW_NAME: 'Documentation Drift Detector'
1042
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1043
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
1044
- GH_AW_NOOP_MESSAGE: ${{ steps.noop.outputs.noop_message }}
1045
- GH_AW_NOOP_REPORT_AS_ISSUE: 'true'
1046
- with:
1047
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1048
- script: |
1049
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1050
- setupGlobals(core, github, context, exec, io);
1051
- const { main } = require('/opt/gh-aw/actions/handle_noop_message.cjs');
1052
- await main();
1053
-
1054
- pre_activation:
1055
- if: (github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)
1056
- runs-on: ubuntu-slim
1057
- outputs:
1058
- activated: ${{ steps.check_membership.outputs.is_team_member == 'true' }}
1059
- matched_command: ''
1060
- steps:
1061
- - name: Setup Scripts
1062
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
1063
- with:
1064
- destination: /opt/gh-aw/actions
1065
- - name: Check team membership for workflow
1066
- id: check_membership
1067
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1068
- env:
1069
- GH_AW_REQUIRED_ROLES: admin,maintainer,write
1070
- with:
1071
- github-token: ${{ secrets.GITHUB_TOKEN }}
1072
- script: |
1073
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1074
- setupGlobals(core, github, context, exec, io);
1075
- const { main } = require('/opt/gh-aw/actions/check_membership.cjs');
1076
- await main();
1077
-
1078
- safe_outputs:
1079
- needs: agent
1080
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (needs.agent.outputs.detection_success == 'true')
1081
- runs-on: ubuntu-slim
1082
- permissions:
1083
- contents: read
1084
- issues: write
1085
- pull-requests: write
1086
- timeout-minutes: 15
1087
- env:
1088
- GH_AW_CALLER_WORKFLOW_ID: '${{ github.repository }}/docs-drift-detector'
1089
- GH_AW_ENGINE_ID: 'copilot'
1090
- GH_AW_ENGINE_MODEL: 'claude-opus-4-20250514'
1091
- GH_AW_WORKFLOW_ID: 'docs-drift-detector'
1092
- GH_AW_WORKFLOW_NAME: 'Documentation Drift Detector'
1093
- outputs:
1094
- code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }}
1095
- code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }}
1096
- comment_id: ${{ steps.process_safe_outputs.outputs.comment_id }}
1097
- comment_url: ${{ steps.process_safe_outputs.outputs.comment_url }}
1098
- create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}
1099
- create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}
1100
- process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
1101
- process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
1102
- steps:
1103
- - name: Setup Scripts
1104
- uses: github/gh-aw/actions/setup@fa061e89469ef007881d22d3af5a8c9e62363a0d # v0.58.1
1105
- with:
1106
- destination: /opt/gh-aw/actions
1107
- - name: Download agent output artifact
1108
- id: download-agent-output
1109
- continue-on-error: true
1110
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
1111
- with:
1112
- name: agent-output
1113
- path: /tmp/gh-aw/safeoutputs/
1114
- - name: Setup agent output environment variable
1115
- if: steps.download-agent-output.outcome == 'success'
1116
- run: |
1117
- mkdir -p /tmp/gh-aw/safeoutputs/
1118
- find "/tmp/gh-aw/safeoutputs/" -type f -print
1119
- echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
1120
- - name: Process Safe Outputs
1121
- id: process_safe_outputs
1122
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1123
- env:
1124
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
1125
- GH_AW_ALLOWED_DOMAINS: 'api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com'
1126
- GITHUB_SERVER_URL: ${{ github.server_url }}
1127
- GITHUB_API_URL: ${{ github.api_url }}
1128
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: '{"add_comment":{"max":3},"missing_data":{},"missing_tool":{}}'
1129
- with:
1130
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
1131
- script: |
1132
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
1133
- setupGlobals(core, github, context, exec, io);
1134
- const { main } = require('/opt/gh-aw/actions/safe_output_handler_manager.cjs');
1135
- await main();
1136
- - name: Upload safe output items manifest
1137
- if: always()
1138
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
1139
- with:
1140
- name: safe-output-items
1141
- path: /tmp/safe-output-items.jsonl
1142
- if-no-files-found: warn