feat: enhance error handling and working directory resolution (#1859)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2024-01-15 11:54:08 -07:00
committed by GitHub
parent bc46e4c422
commit a60bf3759e
3 changed files with 5 additions and 5 deletions

View File

@@ -225,7 +225,7 @@ export async function run(): Promise<void> {
const workingDirectory = path.resolve(
env.GITHUB_WORKSPACE || process.cwd(),
inputs.path
inputs.useRestApi ? '.' : inputs.path
)
core.debug(`Working directory: ${workingDirectory}`)
@@ -271,7 +271,7 @@ export async function run(): Promise<void> {
if (!hasGitDirectory) {
core.info(`Running on a ${github.context.eventName} event...`)
throw new Error(
"Can't find local .git directory. Please run actions/checkout before this action (Make sure the path specified in the 'path' input is correct). If you intend to use Github's REST API note that only pull_request* events are supported."
`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.`
)
}