Skip to content

fix: unepxcted syntax in workflows #5

fix: unepxcted syntax in workflows

fix: unepxcted syntax in workflows #5

Workflow file for this run

name: Validate requirements.txt
on:
pull_request:
push:
jobs:
check-requirements:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check if requirements.txt was modified unexpectedly
run: |
# Get author of last commit
AUTHOR=$(git log -1 --pretty=format:'%an')
# Check if requirements.txt was modified in last commit
if git diff --name-only HEAD~1 HEAD | grep -q "^requirements.txt$"; then
if [ "$AUTHOR" != "github-actions[bot]" ]; then
echo "❌ ERROR: You may NOT edit 'requirements.txt'"
echo "To pin dependencies, use 'poetry add <package-name>'."
echo "Please remove your changes to requirements.txt, so the robot can maintain it."
exit 1
fi
fi
echo "✅ SUCCESS: `requirements.txt` not modified unexpectedly"