Variable rename #4
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: Pylint | |
on: | |
push: | |
paths: | |
- 'Weather Processing/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r "Weather Processing/requirements.txt" | |
- name: Run pylint. | |
run: | | |
pylint --fail-under=8.0 "Weather Processing/*.py" > pylint_recommendations.txt | |
working-directory: ${{ github.workspace }} | |
continue-on-error: true | |
- name: Overwrite linting recommendations in README. | |
run: | | |
awk '/Here are the linting recommendations/{print; print "```python"; system("cat pylint_recommendations.txt"); print "```"; exit} 1' README.md > README.md.tmp | |
mv README.md.tmp README.md | |
working-directory: ${{ github.workspace }} | |
continue-on-error: true | |
- name: Commit and push pylint recommendations. | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "GitHub Actions" | |
git add README.md | |
git diff-index --quiet HEAD || git commit -m "Update README with latest linting recommendations" | |
git push | |
working-directory: ${{ github.workspace }} |