fix: unepxcted syntax in workflows #5
Workflow file for this run
This file contains hidden or 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: | |
| 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" |