update workflow #8
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
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 pylint anybadge | |
- name: Analysing the code with pylint | |
run: | | |
pylint $(git ls-files 'puggle/*.py') --exit-zero | |
- name: Create badge | |
run: | | |
anybadge -l pylint -v 2.22 -f puggle-pylint-badge.svg 2=red 4=orange 8=yellow 10=green | |
- name: Push badge to "Badges" repo | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git clone https://user:$GITHUB_TOKEN@github.com/nlp-tlp/badges | |
cd my-repo | |
git config user.name "github-actions[bot]@users.noreply.github.com" | |
git config user.email "github-actions[bot]" | |
git config --unset-all http.https://github.com/.extraheader | |
cp ../puggle-pylint-badge.svg puggle-pylint-badge.svg | |
git add puggle-pylint-badge.svg | |
git commit -m "Add new badge" | |
git push --set-upstream origin main |