Skip to content

Commit

Permalink
remove all but files list
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudTT committed May 24, 2024
1 parent 2497cb4 commit 22d24bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/liscense-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -66,4 +66,4 @@ jobs:
process.exit(1);
} else {
console.log("No SPDX license issues found.");
}
}

0 comments on commit 22d24bc

Please sign in to comment.