Skip to content

Black and workflow rework #2

Black and workflow rework

Black and workflow rework #2

Workflow file for this run

---
name: 'Python formatting linter (Black)'
on:
workflow_dispatch:
pull_request:
branches:
- main
permissions:
contents: read
pull-requests: read
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
check-black:
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
steps:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ inputs.python }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Install black
shell: bash
run: |
pip install black
- name: Run black
shell: bash
run: |
black --check --diff --color