mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
fix: replace use of any type (#1251)
This commit is contained in:
parent
171dd555b9
commit
3f9dbd5a76
6 changed files with 47 additions and 23 deletions
|
@ -1,6 +1,7 @@
|
|||
import * as core from '@actions/core'
|
||||
import {Inputs} from './create-pull-request'
|
||||
import {Octokit, OctokitOptions} from './octokit-client'
|
||||
import * as utils from './utils'
|
||||
|
||||
const ERROR_PR_REVIEW_FROM_AUTHOR =
|
||||
'Review cannot be requested from pull request author'
|
||||
|
@ -64,10 +65,9 @@ export class GitHubHelper {
|
|||
html_url: pull.html_url,
|
||||
created: true
|
||||
}
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
if (
|
||||
e.message &&
|
||||
e.message.includes(`A pull request already exists for`)
|
||||
utils.getErrorMessage(e).includes(`A pull request already exists for`)
|
||||
) {
|
||||
core.info(`A pull request already exists for ${headBranch}`)
|
||||
} else {
|
||||
|
@ -169,8 +169,8 @@ export class GitHubHelper {
|
|||
pull_number: pull.number,
|
||||
...requestReviewersParams
|
||||
})
|
||||
} catch (e: any) {
|
||||
if (e.message && e.message.includes(ERROR_PR_REVIEW_FROM_AUTHOR)) {
|
||||
} catch (e) {
|
||||
if (utils.getErrorMessage(e).includes(ERROR_PR_REVIEW_FROM_AUTHOR)) {
|
||||
core.warning(ERROR_PR_REVIEW_FROM_AUTHOR)
|
||||
} else {
|
||||
throw e
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue