Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/scripts/validate-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,18 @@ async function run() {
{
name: "Check file naming convention",
test: ({ data }) => {
const normalizedName = data.name.toLowerCase().replace(/ /g, '_');
const expectedImageNamePng = `images/${normalizedName}.png`;
const expectedImageNameJpg = `images/${normalizedName}.jpg`;
const normalisedName = data.name.toLowerCase().replace(/ /g, '_');
const expectedImageNamePng = `images/${normalisedName}.png`;
const expectedImageNameJpg = `images/${normalisedName}.jpg`;
const expectedImageNameJpeg = `images/${normalisedName}.jpeg`;
return (
data.image === expectedImageNamePng ||
data.image === expectedImageNameJpg
data.image === expectedImageNameJpg ||
data.image === expectedImageNameJpeg
);
},
failMsg:
`❌ Image file name in **${file.filename}** should be based on the cow's name. Expected: images/${data.name.toLowerCase().replace(/ /g, '_')}.png or .jpg`
`❌ Image file name in **${file.filename}** should be based on the cow's name. Expected: images/${data.name.toLowerCase().replace(/ /g, '_')}.png or .jpg or .jpeg`
},
{
name: "Check proper indentation",
Expand Down
Loading