From 569926195b2f49b574ecc48971a3f18ba298c1bf Mon Sep 17 00:00:00 2001 From: Hannah Cotterell <143161783+HanCotterell@users.noreply.github.com> Date: Tue, 2 Dec 2025 22:08:10 -0800 Subject: [PATCH] Add support for JPEG image file naming convention --- .github/scripts/validate-pr.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/scripts/validate-pr.js b/.github/scripts/validate-pr.js index 1fb3458..45545fc 100644 --- a/.github/scripts/validate-pr.js +++ b/.github/scripts/validate-pr.js @@ -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",