revert to previous behavior
This commit is contained in:
+1
-13
@@ -3,7 +3,6 @@ import * as core from '@actions/core'
|
|||||||
import * as githubUtils from '@actions/github/lib/utils'
|
import * as githubUtils from '@actions/github/lib/utils'
|
||||||
import * as retry from '@octokit/plugin-retry'
|
import * as retry from '@octokit/plugin-retry'
|
||||||
import {RequestError} from '@octokit/request-error'
|
import {RequestError} from '@octokit/request-error'
|
||||||
import {ConfigurationOptions} from './schemas'
|
|
||||||
|
|
||||||
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry)
|
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry)
|
||||||
const octo = new retryingOctokit(
|
const octo = new retryingOctokit(
|
||||||
@@ -13,20 +12,9 @@ const octo = new retryingOctokit(
|
|||||||
// Comment Marker to identify an existing comment to update, so we don't spam the PR with comments
|
// Comment Marker to identify an existing comment to update, so we don't spam the PR with comments
|
||||||
const COMMENT_MARKER = '<!-- dependency-review-pr-comment-marker -->'
|
const COMMENT_MARKER = '<!-- dependency-review-pr-comment-marker -->'
|
||||||
|
|
||||||
export async function commentPr(
|
export async function commentPr(summary: typeof core.summary): Promise<void> {
|
||||||
summary: typeof core.summary,
|
|
||||||
config: ConfigurationOptions
|
|
||||||
): Promise<void> {
|
|
||||||
const commentContent = summary.stringify()
|
const commentContent = summary.stringify()
|
||||||
|
|
||||||
if (
|
|
||||||
config.comment_summary_in_pr === 'always' ||
|
|
||||||
(config.comment_summary_in_pr === 'on-failure' &&
|
|
||||||
process.exitCode === core.ExitCode.Failure)
|
|
||||||
) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
core.setOutput('comment-content', commentContent)
|
core.setOutput('comment-content', commentContent)
|
||||||
|
|
||||||
if (!github.context.payload.pull_request) {
|
if (!github.context.payload.pull_request) {
|
||||||
|
|||||||
+7
-1
@@ -144,7 +144,13 @@ async function run(): Promise<void> {
|
|||||||
|
|
||||||
summary.addScannedDependencies(changes)
|
summary.addScannedDependencies(changes)
|
||||||
printScannedDependencies(changes)
|
printScannedDependencies(changes)
|
||||||
await commentPr(core.summary, config)
|
if (
|
||||||
|
config.comment_summary_in_pr === 'always' ||
|
||||||
|
(config.comment_summary_in_pr === 'on-failure' &&
|
||||||
|
process.exitCode === core.ExitCode.Failure)
|
||||||
|
) {
|
||||||
|
await commentPr(core.summary)
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof RequestError && error.status === 404) {
|
if (error instanceof RequestError && error.status === 404) {
|
||||||
core.setFailed(
|
core.setFailed(
|
||||||
|
|||||||
Reference in New Issue
Block a user