Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f57104b

Browse filesBrowse files
richardlauaddaleax
authored andcommitted
doc,tools: annotate broken links in actions workflow
Change format of logged messages when run on GitHub Actions (i.e. when the `GITHUB_ACTIONS` environment variable is true) so that broken links are highlighted inline in pull requests. Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: #34810 Refs: #34787 Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent ea56aea commit f57104b
Copy full SHA for f57104b

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎tools/doc/checkLinks.js‎

Copy file name to clipboardExpand all lines: tools/doc/checkLinks.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ function checkFile(path) {
5050
const targetURL = new URL(node.url, base);
5151
if (targetURL.protocol === 'file:' && !fs.existsSync(targetURL)) {
5252
const { line, column } = node.position.start;
53-
console.error(`Broken link at ${path}:${line}:${column} (${node.url})`);
53+
console.error((process.env.GITHUB_ACTIONS ?
54+
`::error file=${path},line=${line},col=${column}::` : '') +
55+
`Broken link at ${path}:${line}:${column} (${node.url})`);
5456
process.exitCode = 1;
5557
}
5658
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.