Skip to content

Commit a60bf37

Browse files
feat: enhance error handling and working directory resolution (#1859)
Co-authored-by: GitHub Action <[email protected]>
1 parent bc46e4c commit a60bf37

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export async function run(): Promise<void> {
225225

226226
const workingDirectory = path.resolve(
227227
env.GITHUB_WORKSPACE || process.cwd(),
228-
inputs.path
228+
inputs.useRestApi ? '.' : inputs.path
229229
)
230230
core.debug(`Working directory: ${workingDirectory}`)
231231

@@ -271,7 +271,7 @@ export async function run(): Promise<void> {
271271
if (!hasGitDirectory) {
272272
core.info(`Running on a ${github.context.eventName} event...`)
273273
throw new Error(
274-
"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."
274+
`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.`
275275
)
276276
}
277277

0 commit comments

Comments
 (0)