diff --git a/src/main.ts b/src/main.ts index f263be05..8b3c2d83 100644 --- a/src/main.ts +++ b/src/main.ts @@ -307,6 +307,13 @@ export async function run(): Promise { } await getChangedFilesFromRESTAPI({inputs, env, workingDirectory}) } else { + if (!hasGitDirectory) { + core.setFailed( + "Can't find local .git directory. Please run actions/checkout before this action" + ) + return + } + core.info('Running via local git') await getChangedFilesFromLocalGit({inputs, env, workingDirectory}) }