Skip to content

github-workflows-require-timeout git hook #639

@ulgens

Description

@ulgens

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions