@@ -4,8 +4,10 @@ import { readFile } from "node:fs/promises"
44import { resolve } from "node:path"
55
66const root = resolve ( new URL ( ".." , import . meta. url ) . pathname )
7- const docsAgentRevision = "5344a4bfbda4a0553cc92636258e46a715b1c72d"
8- const wpCodeboxRevision = "54c2f9a7bc3cd1fe20055d496c83efcfb99afb41"
7+ const docsAgentRevision = "397f32e5c82f662199f2c3555e32804ed0365d7f"
8+ const docsAgentPackageRevision = "7b2df969c34de112ec7ad13189ba94226a7f76f3"
9+ const wpCodeboxRevision = "a2b02cd99ba645ba2250bf58c943bdd1eb13e690"
10+ const wpCodeboxWorkflowRef = "v0.12.23"
911const docsAgentDir = process . env . DOCS_AGENT_DIR
1012const wpCodeboxDir = process . env . WP_CODEBOX_DIR
1113
@@ -21,8 +23,8 @@ assert.equal(revision(wpCodeboxDir), wpCodeboxRevision, "WP Codebox checkout mus
2123const docsAgentWorkflow = await readFile ( resolve ( docsAgentDir , ".github/workflows/maintain-docs.yml" ) , "utf8" )
2224const wpCodeboxContract = await readJson ( wpCodeboxDir , "contracts/run-agent-task-reusable-workflow-interface.v1.json" )
2325assert . equal ( wpCodeboxContract . schema , "wp-codebox/reusable-workflow-interface/v1" )
24- assert . match ( docsAgentWorkflow , new RegExp ( `uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@${ wpCodeboxRevision } ` ) )
25- assert . match ( docsAgentWorkflow , / D O C S _ A G E N T _ R E V I S I O N : \$ \{ \{ g i t h u b \. j o b _ w o r k f l o w _ s h a \} \} / )
26+ assert . match ( docsAgentWorkflow , new RegExp ( `uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@${ wpCodeboxWorkflowRef } ` ) )
27+ assert . match ( docsAgentWorkflow , new RegExp ( `DOCS_AGENT_PACKAGE_REVISION: ${ docsAgentPackageRevision } ` ) )
2628assert . match ( docsAgentWorkflow , / O P E N A I _ A P I _ K E Y : \$ \{ \{ s e c r e t s \. O P E N A I _ A P I _ K E Y \} \} / )
2729assert . match ( docsAgentWorkflow , / A C C E S S _ T O K E N : \$ \{ \{ g i t h u b \. t o k e n \} \} / )
2830assert . match ( docsAgentWorkflow , / E X T E R N A L _ P A C K A G E _ S O U R C E _ P O L I C Y : \$ \{ \{ s e c r e t s \. E X T E R N A L _ P A C K A G E _ S O U R C E _ P O L I C Y \} \} / )
@@ -42,12 +44,14 @@ const workflows = [
4244 path : ".github/workflows/developer-docs-agent.yml" ,
4345 audience : "technical" ,
4446 runKind : true ,
47+ revision : docsAgentRevision ,
4548 writablePaths : "README.md,docs/**,plugins/**/README.md" ,
4649 } ,
4750 {
4851 path : ".github/workflows/skills-agent.yml" ,
4952 audience : "skills" ,
5053 runKind : false ,
54+ revision : "main" ,
5155 writablePaths : "skills/**,plugins/**/skills/**,plugins/**/README.md" ,
5256 } ,
5357]
@@ -61,7 +65,7 @@ for (const workflow of workflows) {
6165 const usedInputs = [ ...withBlock . matchAll ( / ^ ( [ a - z _ ] + ) : / gm) ] . map ( ( match ) => match [ 1 ] )
6266 const usedSecrets = [ ...secretsBlock . matchAll ( / ^ ( [ A - Z _ ] + ) : / gm) ] . map ( ( match ) => match [ 1 ] )
6367
64- assert . match ( source , / u s e s : A u t o m a t t i c \ /d o c s - a g e n t \ / .g i t h u b \ /w o r k f l o w s \ /m a i n t a i n - d o c s .y m l @ m a i n / )
68+ assert . match ( source , new RegExp ( ` uses: Automattic/docs-agent/.github/workflows/maintain-docs.yml@${ workflow . revision } ` ) )
6569 assert . deepEqual ( usedInputs , [ ...new Set ( usedInputs ) ] , `${ workflow . path } must not declare an input twice` )
6670 assert . ok ( usedInputs . every ( ( input ) => docsAgentInputs . includes ( input ) || input === "validation_dependencies" ) , `${ workflow . path } uses an input absent from the Docs Agent schema` )
6771 assert . deepEqual ( usedSecrets , [ "OPENAI_API_KEY" , "EXTERNAL_PACKAGE_SOURCE_POLICY" ] , `${ workflow . path } must forward the Docs Agent secrets` )
@@ -89,8 +93,10 @@ for (const workflow of workflows) {
8993 assert . ok ( dispatchInputs , "Developer Docs workflow must offer a manual run mode" )
9094 assert . match ( dispatchInputs , / r u n _ k i n d : \n d e s c r i p t i o n : D o c u m e n t a t i o n r u n m o d e \n r e q u i r e d : f a l s e \n d e f a u l t : m a i n t e n a n c e \n t y p e : c h o i c e \n o p t i o n s : \n - m a i n t e n a n c e \n - b o o t s t r a p / )
9195 assert . match ( source , / r u n _ k i n d : \$ \{ \{ g i t h u b \. e v e n t \. i n p u t s \. r u n _ k i n d \| \| ' m a i n t e n a n c e ' \} \} / )
96+ assert . match ( source , / r e q u i r e _ p r : \$ \{ \{ g i t h u b \. e v e n t _ n a m e = = ' w o r k f l o w _ d i s p a t c h ' \} \} / )
9297 } else {
9398 assert . doesNotMatch ( source , / ^ r u n _ k i n d : / m)
99+ assert . doesNotMatch ( source , / ^ r e q u i r e _ p r : / m)
94100 }
95101}
96102
0 commit comments