Shell on GitHub actions did not support the exec
command. This enable the used of pre-commit in github actions.
With this a linting job can be configured as follows:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Update python environment
run: |
pip install --upgrade pre-commit
- name: Run all linters
run: pre-commit run --all-files