Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new API to skip annotations all-to-gether #1221

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ inputs:
annotations_limit:
description: 'Specify the limit for annotations. This will also interrupt parsing all test-suites if the limit is reached.'
required: false
skip_annotations:
description: 'Setting this flag will result in no annotations being added to the run.'
required: false
truncate_stack_traces:
description: 'Truncate stack traces from test output to 2 lines in annotations'
required: false
Expand Down
17 changes: 10 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export async function run(): Promise<void> {
const transformers = readTransformers(core.getInput('transformers', {trimWhitespace: true}))
const followSymlink = core.getBooleanInput('follow_symlink')
const annotationsLimit = Number(core.getInput('annotations_limit') || -1)
const skipAnnotations = core.getInput('skip_annotations') === 'true'
const truncateStackTraces = core.getBooleanInput('truncate_stack_traces')

if (excludeSources.length === 0) {
Expand Down Expand Up @@ -114,24 +115,26 @@ export async function run(): Promise<void> {
core.endGroup()
core.startGroup(`🚀 Publish results`)

try {
for (const testResult of testResults) {
await annotateTestResult(
testResult,
token,
headSha,
checkAnnotations,
annotateOnly,
updateCheck,
annotateNotice,
jobName
if (!skipAnnotations) {
try {
for (const testResult of testResults) {
await annotateTestResult(
testResult,
token,
headSha,
checkAnnotations,
annotateOnly,
updateCheck,
annotateNotice,
jobName
)
}
} catch (error) {
core.error(`❌ Failed to create checks using the provided token. (${error})`)
core.warning(
`⚠️ This usually indicates insufficient permissions. More details: https://github.com/mikepenz/action-junit-report/issues/23`
)
}
} catch (error) {
core.error(`❌ Failed to create checks using the provided token. (${error})`)
core.warning(
`⚠️ This usually indicates insufficient permissions. More details: https://github.com/mikepenz/action-junit-report/issues/23`
)
}

const supportsJobSummary = process.env['GITHUB_STEP_SUMMARY']
Expand Down
Loading