@@ -119,6 +119,27 @@ public function refreshWillSkipPublicationWhenTheRenderedWikiDoesNotChange(): vo
119119 self ::assertSame ('' , trim ($ status ->getOutput ()));
120120 }
121121
122+ /**
123+ * @return void
124+ */
125+ #[Test]
126+ public function refreshWillReportPointerDriftWhenTheWikiRemoteAdvancedWithoutNewRenderedChanges (): void
127+ {
128+ $ workspace = $ this ->createWorkspaceWithWikiSubmodule ();
129+ $ this ->advanceWikiRemote ();
130+ $ this ->createMockDevToolsBinary (false );
131+ $ outputFile = $ this ->workspace . '/github-output ' ;
132+
133+ $ this ->runAction ($ workspace , $ outputFile );
134+
135+ $ outputs = $ this ->parseKeyValueFile ($ outputFile );
136+ $ status = $ this ->runProcess (['git ' , 'status ' , '--short ' , '.github/wiki ' ], $ workspace );
137+
138+ self ::assertSame ('false ' , $ outputs ['published ' ]);
139+ self ::assertSame ('true ' , $ outputs ['pointer-changed ' ]);
140+ self ::assertStringContainsString ('.github/wiki ' , $ status ->getOutput ());
141+ }
142+
122143 /**
123144 * @return string
124145 */
@@ -185,6 +206,19 @@ private function createMockDevToolsBinary(bool $shouldChange): void
185206 chmod ($ binDirectory . '/dev-tools ' , 0o755 );
186207 }
187208
209+ /**
210+ * @return void
211+ */
212+ private function advanceWikiRemote (): void
213+ {
214+ $ wikiSeed = $ this ->workspace . '/wiki-seed ' ;
215+
216+ file_put_contents ($ wikiSeed . '/README.md ' , "# Wiki \n\nUpdated upstream. \n" );
217+ $ this ->runProcess (['git ' , 'add ' , 'README.md ' ], $ wikiSeed );
218+ $ this ->runProcess (['git ' , 'commit ' , '-m ' , 'Advance wiki remote ' ], $ wikiSeed );
219+ $ this ->runProcess (['git ' , 'push ' , 'origin ' , 'master ' ], $ wikiSeed );
220+ }
221+
188222 /**
189223 * @param string $workspace
190224 * @param string $outputFile
0 commit comments