debugging #55
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: | |
branches: | |
- main | |
paths-ignore: | |
- '**/README.md' | |
jobs: | |
lint: | |
name: PyLint Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./requirements.txt | |
- name: run pylint on all python files | |
run: | | |
pylint --exit-zero $(git ls-files "*.py") | |
- name: run pylint score updater | |
run: python ./utils/pylint_score_updater.py | |
- name: config git user identity | |
run: | | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config user.name "${GITHUB_ACTOR}" | |
- name: check if pylint score has changed | |
working-directory: ${{ github.workspace }} | |
run: | | |
set +e | |
diff_result=$(git diff --exit-code ./README.md) | |
set -e | |
has_changed="False"; [ -n "$diff_result" ] && has_changed="True" | |
echo "{has_changed}={$has_changed}" >> $GITHUB_OUTPUT | |
echo "debugging..." | |
echo "$has_changed" | |
echo "done." | |
- name: debug has_changed value | |
run: echo "has_changed=${{ steps.check_if_pylint_score_has_changed.outputs.has_changed }}" | |
- name: commit and push changes if any | |
if: ${{ needs.check_changes.outputs.has_changed == 'true' }} | |
run: | | |
git add README.md | |
git commit -m "automatically update pylint score in the badge" | |
git push |