@@ -17,6 +17,7 @@ const resolveScript = workflow.jobs.resolve.steps[0].with.script as string
1717const SHA = "a" . repeat ( 40 )
1818const OLD_SHA = "b" . repeat ( 40 )
1919const REVIEWED_AT = Date . parse ( "2026-08-29T15:02:00Z" )
20+ const WORKFLOW_RUN_URL = "https://github.com/Zoo-Code-Org/Zoo-Code/actions/runs/123456"
2021
2122type ReviewState = "APPROVED" | "CHANGES_REQUESTED" | "COMMENTED" | "DISMISSED"
2223
@@ -492,6 +493,8 @@ function buildReconcileHarness(options: HarnessOptions = {}) {
492493 const context = {
493494 eventName,
494495 repo : { owner : "Zoo-Code-Org" , repo : "Zoo-Code" } ,
496+ runId : 123456 ,
497+ serverUrl : "https://github.com" ,
495498 payload,
496499 runNumber : options . runNumber ?? 1 ,
497500 }
@@ -1935,7 +1938,12 @@ describe("PR review-state workflow", () => {
19351938 const result = await runWorkflow ( )
19361939
19371940 expect ( latestGateStatus ( result ) ) . toEqual (
1938- expect . objectContaining ( { context : "Zoo Code / PR review gate" , sha : SHA , state : "pending" } ) ,
1941+ expect . objectContaining ( {
1942+ context : "Zoo Code / PR review gate" ,
1943+ sha : SHA ,
1944+ state : "pending" ,
1945+ target_url : WORKFLOW_RUN_URL ,
1946+ } ) ,
19391947 )
19401948 } )
19411949
@@ -1955,6 +1963,27 @@ describe("PR review-state workflow", () => {
19551963 expect ( result . addLabels ) . toHaveBeenCalledWith ( expect . objectContaining ( { labels : [ "awaiting-coderabbit" ] } ) )
19561964 } )
19571965
1966+ it ( "publishes a changed review gate status with the workflow run URL" , async ( ) => {
1967+ const result = await runWorkflow ( {
1968+ gateStatuses : [
1969+ {
1970+ context : "Zoo Code / PR review gate" ,
1971+ state : "pending" ,
1972+ description : "Wait for the required CI checks to finish." ,
1973+ targetUrl : "https://github.com/Zoo-Code-Org/Zoo-Code/pull/1437" ,
1974+ } ,
1975+ ] ,
1976+ } )
1977+
1978+ expect ( latestGateStatus ( result ) ) . toEqual (
1979+ expect . objectContaining ( {
1980+ state : "pending" ,
1981+ description : "Required CI passed. Waiting for automated review of the latest commit." ,
1982+ target_url : WORKFLOW_RUN_URL ,
1983+ } ) ,
1984+ )
1985+ } )
1986+
19581987 it ( "continues metadata reconciliation when gate publication fails" , async ( ) => {
19591988 const result = await runWorkflow ( { createCommitStatusErrorStatus : 500 } )
19601989
0 commit comments