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
2727 ) . split ( '\n' ) . filter ( Boolean ) ;
2828 } catch ( _error ) {
2929 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+
3042 throw new Error ( [
3143 `Cannot detect changed files for --only-changed mode:` ,
3244 `git ${ command } ` ,
You can’t perform that action at this time.
0 commit comments