mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Remove direct use of octokit/request-error (#632)
This commit is contained in:
@@ -3,7 +3,6 @@ import * as github from '@actions/github'
|
||||
import * as glob from '@actions/glob'
|
||||
import {DefaultArtifactClient} from '@actions/artifact'
|
||||
import {GitHub} from '@actions/github/lib/utils'
|
||||
import {RequestError} from '@octokit/request-error'
|
||||
import type {PullRequestEvent} from '@octokit/webhooks-types'
|
||||
|
||||
import * as path from 'path'
|
||||
@@ -191,7 +190,7 @@ async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<v
|
||||
try {
|
||||
await submitDependencyGraphFile(dependencyGraphFile)
|
||||
} catch (error) {
|
||||
if (error instanceof RequestError) {
|
||||
if (error instanceof Error && error.name === 'HttpError') {
|
||||
error.message = translateErrorMessage(dependencyGraphFile, error)
|
||||
}
|
||||
throw error
|
||||
@@ -199,7 +198,7 @@ async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<v
|
||||
}
|
||||
}
|
||||
|
||||
function translateErrorMessage(jsonFile: string, error: RequestError): string {
|
||||
function translateErrorMessage(jsonFile: string, error: Error): string {
|
||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
||||
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${error.message}`
|
||||
if (error.message === 'Resource not accessible by integration') {
|
||||
|
||||
Reference in New Issue
Block a user