File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
packages/playwright/src/runner Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,18 @@ export async function detectChangedTestFiles(baseCommit: string, configDir: stri
27
27
) . split ( '\n' ) . filter ( Boolean ) ;
28
28
} catch ( _error ) {
29
29
const error = _error as childProcess . SpawnSyncReturns < string > ;
30
+
31
+ const unknownRevision = error . output . some ( line => line ?. includes ( 'unknown revision' ) ) ;
32
+ if ( unknownRevision ) {
33
+ const isShallowClone = childProcess . execSync ( 'git rev-parse --is-shallow-repository' , { encoding : 'utf-8' , stdio : 'pipe' } ) . trim ( ) === 'true' ;
34
+ if ( isShallowClone ) {
35
+ throw new Error ( [
36
+ `The repository is a shallow clone and does not have '${ baseCommit } ' available locally.` ,
37
+ `Note that GitHub Actions checkout is shallow by default: https://github.com/actions/checkout`
38
+ ] . join ( '\n' ) ) ;
39
+ }
40
+ }
41
+
30
42
throw new Error ( [
31
43
`Cannot detect changed files for --only-changed mode:` ,
32
44
`git ${ command } ` ,
You can’t perform that action at this time.
0 commit comments