json-yaml-validate
json-yaml-validate copied to clipboard
Feature request: Allow exclude_file to be nonexisting
Hi!
I'm using this validator in a "centralized" solution where we've got reusable workflows.
In this setup I now want to make it "configurable" by allowing the calling repository to have a exclude_file
if needed.
In the reusable workflow I now specifiek a standard file name with the idea: If you want to exclude files in your repository, just add an exclude file.
Did this in this way:
- name: json-yaml-validate
uses: GrantBirki/[email protected]
with:
exclude_file: ".staticignore" # gitignore style file that contains a list of files to exclude
use_gitignore: "false"
I was hoping that it would just ignore (or at least continue) if the file doesn't exist. This would make my static file check "configurable". But I get the following error now:
Error: ENOENT: no such file or directory, open '.staticignore'
at readFileSync (node:fs:448:[20](https://github.com/xxx/xxx/actions/runs/9697194409/job/26760772582?pr=431#step:3:21))
at new Exclude (/home/runner/work/_actions/GrantBirki/json-yaml-validate/v3.0.0/src/functions/exclude.js:16:1)
at run (/home/runner/work/_actions/GrantBirki/json-yaml-validate/v3.0.0/src/main.js:7:1)
at /home/runner/work/_actions/GrantBirki/json-yaml-validate/v3.0.0/src/main.js:14:1
at /home/runner/work/_actions/GrantBirki/json-yaml-validate/v3.0.0/dist/index.js:69289:3
at Object.<anonymous> (/home/runner/work/_actions/GrantBirki/json-yaml-validate/v3.0.0/dist/index.js:69292:12)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Function.Module._load (node:internal/modules/cjs/loader:10[24](https://github.com/xxx/xxx/actions/runs/9697194409/job/26760772582?pr=431#step:3:25):12)```
Can this exclude_file be made in a way that is allows a non existing file to be specified?