Skip to content

Pin backend dependencies using pip-compile #65

Pin backend dependencies using pip-compile

Pin backend dependencies using pip-compile #65

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
check-lockfile:
name: Check backend lockfile is up to date
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure requirements.txt is updated when requirements.in changes
run: |
BASE=${{ github.event.pull_request.base.sha }}
HEAD=${{ github.event.pull_request.head.sha }}
CHANGED=$(git diff --name-only "$BASE" "$HEAD")
if echo "$CHANGED" | grep -q 'backend/requirements\.in'; then
if ! echo "$CHANGED" | grep -q 'backend/requirements\.txt'; then
echo "::error::backend/requirements.in was modified but backend/requirements.txt was not. Please run pip-compile to regenerate the lockfile."
exit 1
fi
fi