From 0e82ec57ee18db391587ebd85f8a7241072b8092 Mon Sep 17 00:00:00 2001 From: p0ny Date: Wed, 8 Jan 2025 14:51:52 +0800 Subject: [PATCH] update --- .github/actions/sql-review/dist/index.js | 8 ++++---- .github/actions/sql-review/index.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/sql-review/dist/index.js b/.github/actions/sql-review/dist/index.js index d0daaff..51c6fcf 100644 --- a/.github/actions/sql-review/dist/index.js +++ b/.github/actions/sql-review/dist/index.js @@ -96,7 +96,7 @@ function run() { const version = versionM[0]; const content = yield fs_1.promises.readFile(file, "utf8"); files.push({ - name: file, + path: file, statement: content, version: version, changeType: "DDL", @@ -128,9 +128,9 @@ function run() { } const responseData = yield response.json(); core.debug("Reviews:" + JSON.stringify(responseData.results)); - for (let i = 0; i < files.length; i++) { - const advices = responseData.results[i].advices; - const file = files[i].name; + for (const result of responseData.results) { + const advices = result.advices; + const file = result.file; advices.forEach((advice) => { const annotation = `::${advice.status} file=${file},line=${advice.line},col=${advice.column},title=${advice.title} (${advice.code})::${advice.content}. https://www.bytebase.com/docs/reference/error-code/advisor#${advice.code}`; // Emit annotations for each advice diff --git a/.github/actions/sql-review/index.ts b/.github/actions/sql-review/index.ts index 6435dca..027be89 100644 --- a/.github/actions/sql-review/index.ts +++ b/.github/actions/sql-review/index.ts @@ -71,7 +71,7 @@ async function run(): Promise { const version = versionM[0] const content = await fs.readFile(file, "utf8"); files.push({ - name: file, + path: file, statement: content, version: version, changeType: "DDL", @@ -110,9 +110,9 @@ async function run(): Promise { core.debug("Reviews:" + JSON.stringify(responseData.results)); - for (let i = 0; i < files.length; i++) { - const advices = responseData.results[i].advices; - const file = files[i].name; + for (const result of responseData.results) { + const advices = result.advices; + const file = result.file; advices.forEach( (advice: {