Loading src/dependency-graph.ts +13 −6 Changes for src/dependency-graph.ts: 13 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -78,12 +78,7 @@ async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<v await submitDependencyGraphFile(jsonFile) } catch (error) { if (error instanceof RequestError) { const relativeJsonFile = getRelativePathFromWorkspace(jsonFile) core.warning( `Failed to submit dependency graph ${relativeJsonFile}.\n` + "Please ensure that the 'contents: write' permission is available for the workflow job.\n" + "Note that this permission is never available for a 'pull_request' trigger from a repository fork." ) core.warning(buildWarningMessage(jsonFile, error)) } else { throw error } Loading @@ -91,6 +86,18 @@ async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<v } } function buildWarningMessage(jsonFile: string, error: RequestError): string { const relativeJsonFile = getRelativePathFromWorkspace(jsonFile) const mainWarning = `Failed to submit dependency graph ${relativeJsonFile}.\n${String(error)}` if (error.message === 'Resource not accessible by integration') { return `${mainWarning} Please ensure that the 'contents: write' permission is available for the workflow job. Note that this permission is never available for a 'pull_request' trigger from a repository fork. ` } return mainWarning } async function submitDependencyGraphFile(jsonFile: string): Promise<void> { const octokit = getOctokit() const jsonContent = fs.readFileSync(jsonFile, 'utf8') Loading Loading
src/dependency-graph.ts +13 −6 Changes for src/dependency-graph.ts: 13 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -78,12 +78,7 @@ async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<v await submitDependencyGraphFile(jsonFile) } catch (error) { if (error instanceof RequestError) { const relativeJsonFile = getRelativePathFromWorkspace(jsonFile) core.warning( `Failed to submit dependency graph ${relativeJsonFile}.\n` + "Please ensure that the 'contents: write' permission is available for the workflow job.\n" + "Note that this permission is never available for a 'pull_request' trigger from a repository fork." ) core.warning(buildWarningMessage(jsonFile, error)) } else { throw error } Loading @@ -91,6 +86,18 @@ async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<v } } function buildWarningMessage(jsonFile: string, error: RequestError): string { const relativeJsonFile = getRelativePathFromWorkspace(jsonFile) const mainWarning = `Failed to submit dependency graph ${relativeJsonFile}.\n${String(error)}` if (error.message === 'Resource not accessible by integration') { return `${mainWarning} Please ensure that the 'contents: write' permission is available for the workflow job. Note that this permission is never available for a 'pull_request' trigger from a repository fork. ` } return mainWarning } async function submitDependencyGraphFile(jsonFile: string): Promise<void> { const octokit = getOctokit() const jsonContent = fs.readFileSync(jsonFile, 'utf8') Loading