-
Notifications
You must be signed in to change notification settings - Fork 122
28 lines (25 loc) · 1.01 KB
/
black_check.yml
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
# See documentation of Lintly at: https://github.com/grantmcconnaughey/Lintly
name: black-check-command
on:
# Event generated by Slash Command Dispatch
repository_dispatch:
types: [black-check-command]
jobs:
black-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: pip install black lintly
- name: Check code with black
run: black . --check 2>&1 >/dev/null | lintly --format=black --log --fail-on=new --pr=${{ github.event.client_payload.pull_request.number }} --commit-sha=${{ github.event.client_payload.pull_request.head.sha }}
env:
LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }}