Notify a github webhook when code quality checks fail on main (#23) #128
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: Run code quality checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
code-quality: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- uses: yezz123/setup-uv@v4 | |
- run: uv sync | |
- run: .venv/bin/ruff check | |
notify-on-failure: | |
name: Notify on Code Quality Failures | |
if: ${{ failure() }} | |
needs: | |
- code-quality | |
runs-on: ubuntu-latest | |
steps: | |
- uses: nobrayner/discord-webhook@v1 | |
with: | |
github-token: ${{ secrets.github_token }} | |
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }} |