Skip to content

Merge pull request #125 from NiklasMelton/update-dois #30

Merge pull request #125 from NiklasMelton/update-dois

Merge pull request #125 from NiklasMelton/update-dois #30

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 }}