Skip to content

Commit 0bd1e4e

Browse files
committed
pr-verification error fix
1 parent b54aaa6 commit 0bd1e4e

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

.github/workflows/pr-verification.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ jobs:
2929
const pr = context.payload.pull_request;
3030
const body = pr.body || '';
3131
32-
// List of mandatory PR sections
33-
const requiredSections =
34-
[
32+
// List of mandatory PR sections
33+
const requiredSections = [
3534
{
3635
header: '## Backport',
3736
description: 'PR description must include a "## Backport" section. Please add this section and provide information about this PR backport to develop or develop-2.0.0 branch respectively or explain why backport is not needed.'
@@ -42,19 +41,21 @@ jobs:
4241
},
4342
{
4443
header: '### Documentation',
45-
description: 'PR description must include a "### Documentation" section. Please add this section and provide information about the documentation changes made in this PR. It's important to keep the documentation up to date with the code changes.'
44+
description: 'PR description must include a "### Documentation" section. Please add this section and provide information about the documentation changes made in this PR. It is important to keep the documentation up to date with the code changes.'
4645
}
4746
];
4847
4948
const missing = requiredSections.filter(section => !body.includes(section.header));
5049
5150
if (missing.length > 0) {
52-
const message = [
53-
'PR description is missing the following required section(s):',
54-
...missing.map(
55-
s => `- ${s.header}: ${s.description}`
56-
),
57-
'\nPlease add them to your PR description.'
58-
].join('\n');
51+
let message = 'PR description is missing the following required section(s):\n';
52+
53+
const missingDescriptions = missing.map(
54+
s => `- ${s.header}: ${s.description}`
55+
);
56+
57+
message += missingDescriptions.join('\n');
58+
message += '\n\nPlease add them to your PR description.';
59+
5960
core.setFailed(message);
6061
}

0 commit comments

Comments
 (0)