Skip to content

bastionplatforms/pre-commit-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

207 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

bastionplatforms/pre-commit-action

A GitHub action to run pre-commit.

This is a fork of pre-commit/action with a few changes:

  • updates action versions to silence deprecation warnings
  • adds a extra_cache_key input to allow users to specify additional context to be included in the final cache key

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: [main]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-python@v3
    - uses: bastionplatforms/pre-commit-action@v1.0.0

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: bastionplatforms/pre-commit-action@v1.0.0
      with:
        extra_args: flake8 --all-files

About

a GitHub action to run `pre-commit`

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors