Skip to content

Commit

Permalink
feat: use new step summary, instead of annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mchenryc authored and deblockt committed Jun 3, 2022
1 parent 60602f8 commit 705e822
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 27 deletions.
18 changes: 6 additions & 12 deletions dist/index.js
Expand Up @@ -12278,16 +12278,6 @@ async function buildPendingAnnotation(cucumberError, statusOnPending) {
const pullRequest = github.context.payload.pull_request;
const head_sha = (pullRequest && pullRequest.head.sha) || github.context.sha;
const annotations = [
{
path: "test",
start_line: 0,
end_line: 0,
start_column: 0,
end_column: 0,
annotation_level: 'notice',
title: 'Cucumber report summary',
message: summary,
},
...errorAnnotations
];

Expand Down Expand Up @@ -12318,9 +12308,13 @@ async function buildPendingAnnotation(cucumberError, statusOnPending) {
},
};

core.info(summary);
core.info('Creating summary: ' + summary);
await core.summary
.addHeading(checkName + additionnalTitleInfo, 4)
.addRaw("\n" + summary)
.write()

core.info("send global cucumber report data");
core.info('Sending cucumber annotations');
const octokit = github.getOctokit(accessToken);
await octokit.checks.create(createCheckRequest);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions index.js
Expand Up @@ -123,16 +123,6 @@ async function buildPendingAnnotation(cucumberError, statusOnPending) {
const pullRequest = github.context.payload.pull_request;
const head_sha = (pullRequest && pullRequest.head.sha) || github.context.sha;
const annotations = [
{
path: "test",
start_line: 0,
end_line: 0,
start_column: 0,
end_column: 0,
annotation_level: 'notice',
title: 'Cucumber report summary',
message: summary,
},
...errorAnnotations
];

Expand Down Expand Up @@ -163,9 +153,13 @@ async function buildPendingAnnotation(cucumberError, statusOnPending) {
},
};

core.info(summary);
core.info('Creating summary: ' + summary);
await core.summary
.addHeading(checkName + additionnalTitleInfo, 4)
.addRaw("\n" + summary)
.write()

core.info("send global cucumber report data");
core.info('Sending cucumber annotations');
const octokit = github.getOctokit(accessToken);
await octokit.checks.create(createCheckRequest);
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/deblockt/cucumber-report-annotations-action#readme",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/core": "^1.8.2",
"@actions/github": "^4.0.0",
"@actions/glob": "^0.1.2"
},
Expand Down

0 comments on commit 705e822

Please sign in to comment.