Skip to content

Commit 1fb66f1

Browse files
Merge branch 'develop' into mdk/develop
2 parents 85a09f8 + 25fbd82 commit 1fb66f1

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

packages/formatters/src/__tests__/github-actions.jest.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ const results: IRuleResult[] = [
3737
character: 60,
3838
},
3939
},
40+
documentationUrl: 'https://example.com/pets',
4041
},
4142
];
4243

4344
describe('GitHub Actions formatter', () => {
4445
test('should be formatted correctly', () => {
4546
expect(githubActions(results, { failSeverity: DiagnosticSeverity.Error }).split('\n')).toEqual([
4647
'::warning title=operation-description,file=__tests__/fixtures/petstore.oas2.yaml,col=9,endColumn=61,line=61,endLine=72::paths./pets.get.description is not truthy%0AMessage can have%0Amultiple lines',
47-
'::warning title=operation-tags,file=__tests__/fixtures/petstore.oas2.yaml,col=9,endColumn=61,line=61,endLine=72::paths./pets.get.tags is not truthy',
48+
'::warning title=operation-tags,file=__tests__/fixtures/petstore.oas2.yaml,col=9,endColumn=61,line=61,endLine=72::paths./pets.get.tags is not truthy%0ADocumentation: https://example.com/pets',
4849
]);
4950
});
5051
});

packages/formatters/src/github-actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const githubActions: Formatter = results => {
4242
const message = result.message.replace(/\n/g, '%0A');
4343

4444
return `::${OUTPUT_TYPES[result.severity]} ${paramsString}::${message}${
45-
result.documentationUrl ? `::${result.documentationUrl}` : ''
45+
result.documentationUrl ? `%0ADocumentation: ${result.documentationUrl}` : ''
4646
}`;
4747
})
4848
.join('\n');

test-harness/scenarios/documentation-url/results-format-github-actions.scenario

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ info:
5454
====command====
5555
{bin} lint {document} --format=github-actions --ruleset "{asset:ruleset.json}" --show-documentation-url
5656
====stdout====
57-
::warning title=api-servers,file=document,col=1,endColumn=19,line=1,endLine=4::"servers" must be present and non-empty array.::https://www.example.com/docs/api-servers.md
57+
::warning title=api-servers,file=document,col=1,endColumn=19,line=1,endLine=4::"servers" must be present and non-empty array.%0ADocumentation: https://www.example.com/docs/api-servers.md
5858
::warning title=info-contact,file=document,col=6,endColumn=19,line=2,endLine=4::Info object must have a "contact" object.
59-
::warning title=info-description,file=document,col=6,endColumn=19,line=2,endLine=4::Info "description" must be present and non-empty string.::https://www.example.com/docs/info-description.md
59+
::warning title=info-description,file=document,col=6,endColumn=19,line=2,endLine=4::Info "description" must be present and non-empty string.%0ADocumentation: https://www.example.com/docs/info-description.md

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14627,9 +14627,9 @@ __metadata:
1462714627
linkType: hard
1462814628

1462914629
"undici@npm:^6.23.0":
14630-
version: 6.23.0
14631-
resolution: "undici@npm:6.23.0"
14632-
checksum: f0953920330375e76d1614381af07da9d7c21ad3244d0785b3f7bd4072635c20a1f432ef3a129baa3e4a92278ce32e9ea2ca8b5f0e0554a5739222af332c08fe
14630+
version: 6.24.1
14631+
resolution: "undici@npm:6.24.1"
14632+
checksum: 0baa81ede2b0deb9002692c4d614cdffb2c8c27bb41e4ce7380f95b4468ebb6fd9745b7a6da32b0cdf05b1554bd5e5a47a80babb0e5ca9d59401efe372d975ed
1463314633
languageName: node
1463414634
linkType: hard
1463514635

0 commit comments

Comments
 (0)