mpalmer / action-validator

Tool to validate GitHub Action and Workflow YAML files
GNU General Public License v3.0
271 stars 25 forks source link

Ability to disable paths/ignores verification, or set root directory #54

Open TWiStErRob opened 1 year ago

TWiStErRob commented 1 year ago

Glob checking will explode horribly if you run it from a sub-directory of the repo -- or, heaven forfend, outside the repository entirely.

In a non-JS project (or even a JS project) having a package.json in the repo root might not be the best thing. In this case one might create a folder to host files specific to using a tool and it is likely necessary that running npx requires your working directory to be this subfolder, so we have a conflict.

Example: https://github.com/TWiStErRob/github-workflows/pull/2/files

Luckily this doesn't affect the quoted repo, because it doesn't have paths/paths-ignores (yet).

Most of my repositories are Gradle/JVM ecosystem based, so if I wanted to set up this tool there, I would use the same pattern as in the above PR. The reason I chose NPM as delivery is because that's what I know a bit apart from Gradle, and is conveniently set up out of the box in GHA.

According to npx docs there's no CLI option to execute npx with a specific node_modules parent folder. There's a strange mention of $prefix, which look like something, but I don't understand it.

mpalmer commented 1 year ago

I'd be happy to merge a PR or two implementing either or both of these features.