Skip to content

chore(deps): update cloudposse/github-action-pre-commit action to v4.1.0 #21

chore(deps): update cloudposse/github-action-pre-commit action to v4.1.0

chore(deps): update cloudposse/github-action-pre-commit action to v4.1.0 #21

Workflow file for this run

---
name: Pull Request validation
on:
- pull_request
permissions:
contents: read
env:
IMAGE_NAME: ophiosdev/ocrpdf
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@v6
- name: Set up Python
id: setup-python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip
- name: Create project venv and install dependencies
run: |
"${{ steps.setup-python.outputs.python-path }}" -m venv .venv
"$PWD/.venv/bin/python" -m pip install -r requirements.txt -r requirements-dev.txt
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
- name: Run pre-commit checks
id: pre-commit
uses: cloudposse/github-action-pre-commit@v4.1.0
- name: Run pytest
run: .venv/bin/pytest
- name: Build Docker image if Dockerfile changed
run: |
if git diff --name-only origin/${{ github.base_ref }} | grep -q '^Dockerfile$'; then
echo "Dockerfile changed — building image..."
docker build -t "${IMAGE_NAME}:pr" .
else
echo "Dockerfile not changed — skipping build."
fi