diff --git a/dist/index.js b/dist/index.js index a8f1e78..315d8d3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -36117,6 +36117,10 @@ yup.addMethod(yup.string, "schemaFileExists", function (srcDir) { return this.test({ name: "schema-file-exists", test: (value) => { + // schema file path is optional, hence return true if it is not present + if (!value) { + return true; + } schemaFilePath = path.join(srcDir, value); try { const hasFile = fs.existsSync(schemaFilePath); @@ -38141,7 +38145,7 @@ async function main() { await validateComponentYaml(sourceRootDir); } catch (error) { console.log("component.yaml validation failed: ", error.message); - core.setFailed("component.yaml validation failed: ", error.message); + core.setFailed("component.yaml validation failed ", error.message); } } diff --git a/index.js b/index.js index 866b414..3910058 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ async function main() { await validateComponentYaml(sourceRootDir); } catch (error) { console.log("component.yaml validation failed: ", error.message); - core.setFailed("component.yaml validation failed: ", error.message); + core.setFailed("component.yaml validation failed ", error.message); } } diff --git a/schemas.js b/schemas.js index f84238d..fe8d21f 100644 --- a/schemas.js +++ b/schemas.js @@ -57,6 +57,10 @@ yup.addMethod(yup.string, "schemaFileExists", function (srcDir) { return this.test({ name: "schema-file-exists", test: (value) => { + // schema file path is optional, hence return true if it is not present + if (!value) { + return true; + } schemaFilePath = path.join(srcDir, value); try { const hasFile = fs.existsSync(schemaFilePath);