-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (32 loc) · 1.29 KB
/
lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check --verbose --color" # --diff
src: "."
# jupyter: true
version: "24.4.2"
- uses: isort/isort-action@f14e57e1d457956c45a19c05a89cccdf087846e5
with: # https://github.com/isort/isort-action
isort-version: 5.13.2
configuration: --check-only --profile black # --diff
notify_failure:
runs-on: ubuntu-latest
needs: [lint]
if: ${{ always() && contains(needs.*.result, 'failure') }} # see https://stackoverflow.com/questions/71430668/how-to-run-a-github-actions-job-on-workflow-failure
steps:
- name: notification
uses: appleboy/discord-action@4c196125180125310ac20c72034757bb71020383
# if: ${{ failure() }}
with:
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
color: "#DAA520" # "#48f442"
avatar_url: "https://black.readthedocs.io/en/stable/_static/logo2-readme.png"
username: "Black Formatter"
message: "The _${{ github.event_name }}_ @ `${{ github.ref_name }}#${{ github.sha }}` needs to be `black` formatted."