diff --git a/.github/workflows/liscense-checker.yml b/.github/workflows/liscense-checker.yml index 0435889b..f81a2bda 100644 --- a/.github/workflows/liscense-checker.yml +++ b/.github/workflows/liscense-checker.yml @@ -48,14 +48,14 @@ jobs: } // Remove ANSI color codes and prepare the output output = output.replace(/\u001b\[.*?m/g, ''); - const formattedOutput = output.split('\n').filter(line => line.trim() !== '').map(line => `- ${line}`).join('\n'); + const fileList = output.split('\n').filter(line => line.trim() !== '').map(line => `- ${line}`).join('\n'); const issueNumber = context.issue.number; const owner = context.repo.owner; const repo = context.repo.repo; - if (formattedOutput) { - const commentBody = `Our automated SPDX license verification process has discovered that the following files are missing a license header:\n\`\`\`\n${formattedOutput}\n\`\`\`\nPlease ensure each indicated file includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Your attention and cooperation in updating these files are greatly appreciated. Thank you.`; + if (fileList) { + const commentBody = `The following files are missing a license header:\n\`\`\`\n${fileList}\n\`\`\`\nPlease ensure each indicated file includes a valid SPDX license identifier.`; await github.rest.issues.createComment({ issue_number: issueNumber, owner: owner, @@ -66,4 +66,4 @@ jobs: process.exit(1); } else { console.log("No SPDX license issues found."); - } \ No newline at end of file + }