Skip to content

Commit

Permalink
Test if github anotations work
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBrest committed May 12, 2024
1 parent 0e1a2d6 commit 1cf1341
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion scripts/core.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ export const checkGameEmbed = async embed => {
return [null, 'web-request-failed'];
}

return [response.statusCode === 200, null];
if (response.statusCode === 200) {
return [true, null];
}
}

return [false, 'invalid-embed'];
Expand Down
5 changes: 4 additions & 1 deletion scripts/lint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const removeRootDir = path => {
return path.replace(CORE_PATHS.rootDir + '/', '');
};

let hasBeenWarned = false;

/**
* Logs a lint violation.
* @param {'warning' | 'error'} type The type of violation.
Expand All @@ -42,6 +44,7 @@ const removeRootDir = path => {
* @param {string} message The violation message.
*/
const logLintViolation = (type = 'error', file, line, column, message) => {
hasBeenWarned = true;
if (isGithubAnotationsMode) {
const args = [];
file !== null && args.push(`file=${removeRootDir(file)}`);
Expand Down Expand Up @@ -350,7 +353,7 @@ const main = async () => {

await Promise.all(markdownFiles.map(file => lintMarkdownFile(file)));

return 0;
return hasBeenWarned ? 1 : 0;
};

if (process.argv[1] === new URL(import.meta.url).pathname)
Expand Down
2 changes: 1 addition & 1 deletion src/game-support/among-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ a
> [!NOTE]
> This game has an iPad Mac port through the App Store.
{{#template ../templates/steam.md id=945360}}
{{#template ../templates/steam.md id=9453609234987329847}}

Check failure on line 9 in src/game-support/among-us.md

View workflow job for this annotation

GitHub Actions / lint

Invalid game embed found in file.
a

Check warning on line 10 in src/game-support/among-us.md

View workflow job for this annotation

GitHub Actions / lint

File should end with a newline.

0 comments on commit 1cf1341

Please sign in to comment.