Update pylint-score.yml #7
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: Configure Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
- name: Update README | |
run: | | |
# Use sed, awk, or a custom script to update the README with the pylint score | |
sed -i "s/PyLint Score:.*/PyLint Score: ${{ env.PYLINT_SCORE }}/" README.md | |
git commit -am "Update PyLint Score" | |
git push |