Skip to content

Instantly share code, notes, and snippets.

@elisim
Created April 7, 2022 17:27
Show Gist options
  • Save elisim/49baa378bb0f95f54a62401f22d050b4 to your computer and use it in GitHub Desktop.
Save elisim/49baa378bb0f95f54a62401f22d050b4 to your computer and use it in GitHub Desktop.
# This workflow finds which files was changed, print them, and then
# run `pre-commit` on those files. I was inspired by sktime:
# https://github.com/alan-turing-institute/sktime/blob/main/.github/workflows/build-and-test.yml
name: Code Quality
on:
pull_request:
branches:
- main
- develop
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- id: file_changes
uses: trilom/file-changes-action@v1.2.4
with:
output: " "
- name: List changed files
run: echo '${{ steps.file_changes.outputs.files}}'
- uses: pre-commit/action@v2.0.0
with:
extra_args: --files ${{ steps.file_changes.outputs.files}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment