Update pylint-score.yml #9
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 Score Report | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
pylint-score: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build and Run Devcontainer | |
run: | | |
# Build and start the container. Modify this command according to your setup. | |
make core-build | |
docker compose -f .devcontainer/docker-compose.yml build | |
docker run -d --name devcontainer model2queue-devcontainer | |
- name: Execute Pylint | |
run: | | |
# Execute pylint inside the devcontainer and extract the score | |
SCORE=$(docker compose -f .devcontainer/docker-compose.yml run devcontainer pylint /workspace/src/model2queue/model2queue | grep 'Your code has been rated at' | awk '{print $7}' | sed 's/\//\-/g') | |
echo "PYLINT_SCORE=$SCORE" >> $GITHUB_ENV | |
- name: Update PyLint Score in README | |
run: | | |
sed -i "s/PyLint Score:.*/PyLint Score: $PYLINT_SCORE/" README.md | |
git config user.email "[email protected]" | |
git config user.name "GitHub Action" | |
git add README.md | |
git commit -m "Update PyLint Score" || echo "No changes to commit" | |
git push |