Merge branch 'main' into develop #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pre-commit checks | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
- main | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' # Adjust this to your desired Python version | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Install dependencies | |
run: | | |
poetry install --with dev | |
- name: Install pre-commit | |
run: | | |
poetry run pip install pre-commit | |
- name: Fetch the base branch | |
run: | | |
git fetch origin ${GITHUB_BASE_REF}:${GITHUB_BASE_REF} | |
env: | |
GITHUB_BASE_REF: ${{ github.event.pull_request.base.ref }} | |
- name: Run pre-commit on changed files | |
run: | | |
poetry run pre-commit run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD | |
env: | |
GITHUB_BASE_REF: ${{ github.event.pull_request.base.ref }} |