Skip to content

Commit 095b659

Browse files
committed
validate icons comment pr
1 parent 6fca489 commit 095b659

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.build/validate-icons.mjs

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ types.forEach(type => {
2424
const iconContent = fs.readFileSync(icon, 'utf-8')
2525

2626
if (!iconContent.includes(iconTemplate(type))) {
27-
console.log(`Icon ${icon} is not properly formatted`)
27+
console.log(`Icon ${icon} is not properly formatted\n`)
2828
error = true
2929
}
3030

3131
if (!iconContent.includes('<!--') || !iconContent.includes('-->')) {
32-
console.log(`Icon ${icon} has no metadata`)
32+
console.log(`Icon ${icon} has no metadata\n`)
3333
error = true
3434
}
3535

@@ -38,40 +38,40 @@ types.forEach(type => {
3838

3939
if (data.unicode) {
4040
if (unicodes.indexOf(data.unicode) !== -1) {
41-
console.log(`Icon ${icon} has duplicate unicode "${data.unicode}"`)
41+
console.log(`Icon ${icon} has duplicate unicode "${data.unicode}"\n`)
4242
error = true
4343
}
4444

4545
if (data.unicode.length !== 4) {
46-
console.log(`Icon ${icon} has invalid unicode "${data.unicode}"`)
46+
console.log(`Icon ${icon} has invalid unicode "${data.unicode}"\n`)
4747
error = true
4848
}
4949

5050
// check duplicates in tags
5151
if (duplicateExists(data.tags || [])) {
52-
console.log(`Icon ${icon} has duplicate tags`)
52+
console.log(`Icon ${icon} has duplicate tags\n`)
5353
error = true
5454
}
5555

5656
unicodes.push(data.unicode)
5757
} else if (argvs.hard) {
58-
console.log(`Icon ${icon} has no unicode`)
58+
console.log(`Icon ${icon} has no unicode\n`)
5959
error = true
6060
}
6161

6262
if (argvs.hard && !data.version) {
63-
console.log(`Icon ${icon} has no version`)
63+
console.log(`Icon ${icon} has no version\n`)
6464
error = true
6565
}
6666
} catch (e) {
67-
console.log(`Icon ${icon} has invalid metadata`)
67+
console.log(`Icon ${icon} has invalid metadata\n`)
6868
error = true
6969
}
7070
})
7171

7272
filledIconsNames.forEach((icon) => {
7373
if (outlineIconsNames.indexOf(icon) === -1) {
74-
console.log(`Icon ${icon} exists in filled version but doesn't exists in outline`)
74+
console.log(`Icon ${icon} exists in filled version but doesn't exists in outline\n`)
7575
error = true
7676
}
7777
})
@@ -81,7 +81,7 @@ types.forEach(type => {
8181
Object.entries(aliases).forEach(([type, replacers]) => {
8282
Object.entries(replacers).forEach(([icon, alias]) => {
8383
if (!fs.existsSync(join(ICONS_SRC_DIR, type, `${alias}.svg`))) {
84-
console.log(`Alias ${icon} for ${alias} in ${type} doesn't exists`)
84+
console.log(`Alias ${icon} for ${alias} in ${type} doesn't exists\n`)
8585
error = true
8686
}
8787
})

.github/workflows/validate-icons.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
- name: Validate icons
4242
id: validate
43-
run: pnpm run --silent validate >> ./comment-markup.md
43+
run: echo \`\`\``pnpm run --silent validate`\`\`\` >> ./comment-markup.md
4444

4545
- name: Comment PR
4646
uses: thollander/actions-comment-pull-request@v2

0 commit comments

Comments
 (0)