Skip to content

Commit

Permalink
Generate error annotations when not publishing a check
Browse files Browse the repository at this point in the history
Using the GitHub Actions to create/update a check with annotations have
multiple drawbacks, and doesn't work well in repositories with complex
workflows. Create error annotations when skip publish option is set,
without using the GHA REST API.
  • Loading branch information
nineinchnick committed Sep 16, 2024
1 parent f9dcf5a commit ae909e1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions action.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ const action = async () => {

if (skipPublishing) {
core.info('Not publishing test result due to skip_publishing=true');
for (const annotation of annotations) {
const properties = {
title: annotation.title,
file: annotation.path,
startLine: annotation.start_line,
endLine: annotation.end_line,
startColumn: annotation.start_column,
endColumn: annotation.end_column
};
core.error(annotation.message, properties);
}
return;
}

Expand Down
11 changes: 11 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ae909e1

Please sign in to comment.