Skip to content

Commit

Permalink
fix: set error types to any
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans committed Sep 2, 2021
1 parent 3e21ec0 commit a9144b5
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 22 deletions.
74 changes: 58 additions & 16 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/create-pull-request.ts
Expand Up @@ -237,7 +237,7 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
}
}
}
} catch (error) {
} catch (error: any) {
core.setFailed(error.message)
} finally {
// Remove auth and restore persisted auth config if it existed
Expand Down
2 changes: 1 addition & 1 deletion src/git-auth-helper.ts
Expand Up @@ -33,7 +33,7 @@ export class GitAuthHelper {
try {
await this.setExtraheaderConfig(this.persistedExtraheaderConfigValue)
core.info('Persisted git credentials restored')
} catch (e) {
} catch (e: any) {
core.warning(e)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/github-helper.ts
Expand Up @@ -60,7 +60,7 @@ export class GitHubHelper {
html_url: pull.html_url,
created: true
}
} catch (e) {
} catch (e: any) {
if (
e.message &&
e.message.includes(`A pull request already exists for ${headBranch}`)
Expand Down Expand Up @@ -165,7 +165,7 @@ export class GitHubHelper {
pull_number: pull.number,
...requestReviewersParams
})
} catch (e) {
} catch (e: any) {
if (e.message && e.message.includes(ERROR_PR_REVIEW_FROM_AUTHOR)) {
core.warning(ERROR_PR_REVIEW_FROM_AUTHOR)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Expand Up @@ -29,7 +29,7 @@ async function run(): Promise<void> {
core.debug(`Inputs: ${inspect(inputs)}`)

await createPullRequest(inputs)
} catch (error) {
} catch (error: any) {
core.setFailed(error.message)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Expand Up @@ -134,7 +134,7 @@ export function fileExistsSync(path: string): boolean {
let stats: fs.Stats
try {
stats = fs.statSync(path)
} catch (error) {
} catch (error: any) {
if (error.code === 'ENOENT') {
return false
}
Expand Down

0 comments on commit a9144b5

Please sign in to comment.