From f61d1b9356896f030a4d1bd220b90260070102a1 Mon Sep 17 00:00:00 2001 From: luckasRanarison Date: Mon, 4 Nov 2024 08:38:17 +0300 Subject: [PATCH] fix: checkout & update script --- .github/workflows/linear-check.yml | 3 +++ tools/linear-checker/src/index.js | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linear-check.yml b/.github/workflows/linear-check.yml index d673d3906..921dd9cab 100644 --- a/.github/workflows/linear-check.yml +++ b/.github/workflows/linear-check.yml @@ -15,6 +15,9 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 with: node-version: 20 diff --git a/tools/linear-checker/src/index.js b/tools/linear-checker/src/index.js index 329d24c71..80f0f1550 100644 --- a/tools/linear-checker/src/index.js +++ b/tools/linear-checker/src/index.js @@ -69,7 +69,7 @@ for (const issue of issues) { `Error: A Linear ticket was not found for the issue "${type}: ${desc}" in the file "${file}" at line ${line}.`, "Consider creating a Linear ticket for this issue and referencing it in the comment.", ); - console.error(`\nSource: ${source}\n`); + console.error(`${line} | ${source}`); foundInvalidIssue = true; } else { const issue = await getIssue(ticket); @@ -78,12 +78,18 @@ for (const issue of issues) { console.error( `Error: The ticket MET-${ticket} referenced in the file "${file}" at line ${line} does not exist`, ); - console.error(`\nSource: ${source}\n`); + console.error(`${line} | ${source}`); foundInvalidIssue = true; + } else { + console.info( + `Info: Found a Linear ticket "MET-${ticket}" in the file "${file}" at line ${line} (${type}: ${desc})`, + ); } } } -if (foundInvalidIssue) { +if (!issues.length) { + console.log("No issues or tickets found"); +} else if (foundInvalidIssue) { process.exit(1); }