Skip to content

Commit

Permalink
Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Jul 5, 2024
1 parent ec43efe commit b96902e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45942,10 +45942,9 @@ async function format(bufPath, inputs) {
if (result.status == Status.Failed && result.stdout.startsWith("diff")) {
// If the format step fails, parse the diff and write github annotations.
const diff = parse_diff(result.stdout);
result.stdout = ""; // Clear the stdout.
console.log("diff", diff);
result.stdout = ""; // Clear the stdout to count the number of changes.
for (const file of diff) {
result.stdout += `::error file=${file.to}::Format failed -${file.deletions} +${file.additions} changes.\n`;
result.stdout += `::error file=${file.to},title=Buf format::Diff -${file.deletions}/+${file.additions}.\n`;
}
console.log(result.stdout);
}
Expand Down
5 changes: 2 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,9 @@ async function format(bufPath: string, inputs: Inputs): Promise<Result> {
if (result.status == Status.Failed && result.stdout.startsWith("diff")) {
// If the format step fails, parse the diff and write github annotations.
const diff = parseDiff(result.stdout);
result.stdout = ""; // Clear the stdout.
console.log("diff", diff);
result.stdout = ""; // Clear the stdout to count the number of changes.
for (const file of diff) {
result.stdout += `::error file=${file.to}::Format failed -${file.deletions} +${file.additions} changes.\n`;
result.stdout += `::error file=${file.to},title=Buf format::Diff -${file.deletions}/+${file.additions}.\n`;
}
console.log(result.stdout);
}
Expand Down

0 comments on commit b96902e

Please sign in to comment.