forked from mdn/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): recycle the weekly spelling check issue (mdn#35653)
* fix(ci): recycle the weekly spelling check issue * escape backquotes * add update timestamp * convert file paths to GitHub code links * emphasize the timestamp * address review comments
- Loading branch information
1 parent
2cca854
commit 6b45b10
Showing
2 changed files
with
40 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* The script converts file paths to GitHub source links in the provided text. | ||
* Usage: node scripts/linkify-logs.js ${logs} | ||
*/ | ||
|
||
const logs = process.argv[2]; | ||
|
||
console.log( | ||
logs.replaceAll( | ||
/(files\/.*?\/index.md):?(\d+)?:?(\d+)?/g, | ||
(_, path, lineNo, columnNo) => { | ||
if (lineNo) { | ||
return `[${path}:${lineNo}:${columnNo}](https://github.com/mdn/content/blob/main/${path}?plain=1#L${lineNo})`; | ||
} | ||
return `[${path}](https://github.com/mdn/content/blob/main/${path}?plain=1)`; | ||
}, | ||
), | ||
); |