Skip to content

Commit

Permalink
Merge 932d20c into 2cb2c92
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Jan 25, 2024
2 parents 2cb2c92 + 932d20c commit 7974fc2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,8 @@ export async function run(): Promise<void> {
})
} else {
if (!hasGitDirectory) {
core.info(`Running on a ${github.context.eventName} event...`)
throw new Error(
`Can't find local .git in ${workingDirectory} directory. Please run actions/checkout before this action (Make sure the 'path' input is correct). If you intend to use Github's REST API note that only pull_request* events are supported.`
`Unable to locate the git repository in the given path: ${workingDirectory}.\n Please run actions/checkout before this action (Make sure the 'path' input is correct).\n If you intend to use Github's REST API note that only pull_request* events are supported. Current event is "${github.context.eventName}".`
)
}

Expand Down
6 changes: 6 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,12 @@ export const isInsideWorkTree = async ({
}
)

if (stdout.trim() !== 'true') {
core.debug(
`The current working directory is not inside a git repository: ${cwd}`
)
}

return stdout.trim() === 'true'
}

Expand Down

0 comments on commit 7974fc2

Please sign in to comment.