Hotfix #14
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
# This workflow runs pylint and updates badge | |
name: pylint | |
on: | |
pull_request: | |
branches: | |
- "main" | |
- "master" | |
- "develop" | |
jobs: | |
black-n-pylint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install black | |
pip install -e .[pylint] | |
- name: Applying black formatting | |
run: | | |
black --diff . | |
black . | |
- name: Pushing changes if any | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Applying black formatting (from Github Action) | |
commit_user_name: sbacchio | |
commit_user_email: [email protected] | |
commit_author: Simone Bacchio <[email protected]> | |
- name: Pylint output | |
run: | | |
badge=$(lyncs_pylint_badge --disable=import-error . | sed "s/\&/\\\&/g") | |
test ! -z "$badge" | |
badge_line=$(awk '/!\[pylint\]/ {print FNR}' README.md) | |
test ! -z "$badge_line" | |
sed -i "${badge_line}s#.*#${badge}#" README.md | |
- name: Pushing changes if any | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Updating pylint score (from Github Action) | |
commit_user_name: sbacchio | |
commit_user_email: [email protected] | |
commit_author: Simone Bacchio <[email protected]> |