Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
RainbowDashy committed Jan 8, 2025
1 parent 0ca30be commit 0e82ec5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/actions/sql-review/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/sql-review/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function run(): Promise<void> {
const version = versionM[0]
const content = await fs.readFile(file, "utf8");
files.push({
name: file,
path: file,
statement: content,
version: version,
changeType: "DDL",
Expand Down Expand Up @@ -110,9 +110,9 @@ async function run(): Promise<void> {

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: {
Expand Down

0 comments on commit 0e82ec5

Please sign in to comment.