I'm using the repository to check GHA files and one of the rules I need to validate is having timeout values.
I'm using pre-commit hooks as my entrypoint. While check-github-actions and check-github-workflows is covering the most with a simple hook definiton, timeout requirement needs a custom hook:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.36.0
hooks:
- id: check-github-actions
- id: check-github-workflows
- id: check-jsonschema
name: "Check GitHub Workflows"
files: ^\.github/workflows/[^/]+$
types: [yaml]
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
I tried to understand why this is the case and why there is no easy to use hook for timeout checks but I couldn't find much. It seems github-workflows-require-timeout defined under CUSTOM_SCHEMA_NAMES but as hooks,
- id: check-github-workflows
entry: check-jsonschema --builtin-schema vendor.github-workflows
files: ^\.github/workflows/[^/]+$
...
doesn't look that different compared to
- id: check-jsonschema
files: ^\.github/workflows/[^/]+$
args: ["--builtin-schema", "github-workflows-require-timeout"]
I think it would be nice to have an easy to use hook for require timeout check, instead of the current custom hook approach.
I'm using the repository to check GHA files and one of the rules I need to validate is having timeout values.
I'm using pre-commit hooks as my entrypoint. While
check-github-actionsandcheck-github-workflowsis covering the most with a simple hook definiton, timeout requirement needs a custom hook:I tried to understand why this is the case and why there is no easy to use hook for timeout checks but I couldn't find much. It seems
github-workflows-require-timeoutdefined underCUSTOM_SCHEMA_NAMESbut as hooks,doesn't look that different compared to
I think it would be nice to have an easy to use hook for require timeout check, instead of the current custom hook approach.