Fix --require-hashes
error on Heroku
#65
Workflow file for this run
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: Validate requirements.txt | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
check-dependency-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch main branch | |
run: git fetch origin main | |
- name: Check if uv.lock or pyproject.toml has changed | |
id: check-changes | |
run: | | |
echo "Checking for changes in uv.lock or pyproject.toml..." | |
CHANGES=$(git diff --name-only origin/main --) | |
if echo "$CHANGES" | grep -qE "^(uv.lock|pyproject.toml)$"; then | |
echo "uv.lock or pyproject.toml has changed." | |
echo "files_changed=true" >> $GITHUB_ENV | |
else | |
echo "No changes detected in uv.lock or pyproject.toml." | |
echo "files_changed=false" >> $GITHUB_ENV | |
fi | |
- name: Validate requirements.txt changes | |
if: env.files_changed == 'true' | |
run: | | |
echo "Validating requirements.txt update..." | |
CHANGED_FILES=$(git diff --name-only origin/main --) | |
# Check if requirements.txt has been updated | |
if echo "$CHANGED_FILES" | grep -q "^requirements.txt$"; then | |
echo "requirements.txt has been updated." | |
else | |
echo "ERROR: pyproject.toml or uv.lock has changed, but requirements.txt has not been updated." | |
echo "Please update requirements.txt by running 'make create-requirements'." | |
exit 1 | |
fi |