Skip to content

A GitHub action to run pre-commit and allow overriding the git config user name and email

License

Notifications You must be signed in to change notification settings

the-iea/github-action-pre-commit

 
 

Repository files navigation

using this action

To use this action, make a file .github/workflows/pre-commit.yml. Here's a template to get started:

name: pre-commit

on:
  pull_request:
  push:
    branches: [master]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-python@v2
    - uses: the-iea/github-action-pre-commit@master

This does a few things:

  • clones the code
  • installs python
  • sets up the pre-commit cache

using this action with custom invocations

By default, this action runs all the hooks against all the files. extra_args lets users specify a single hook id and/or options to pass to pre-commit run.

Here's a sample step configuration that only runs the flake8 hook against all the files (use the template above except for the pre-commit action):

    - uses: the-iea/github-action-pre-commit@v2.1.2
      with:
        extra_args: flake8 --all-files

About

A GitHub action to run pre-commit and allow overriding the git config user name and email

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 77.9%
  • Makefile 22.1%