aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/check-formatting.yml
blob: a1257c68d99722dcb6339c11bec8795a047452ef (plain)
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
name: Check formatting

# Controls when the action will run.
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  merge_group:

  workflow_dispatch:

jobs:
  check_formatting:
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v3

      - name: Run format.sh and print changes
        env:
          CI: 1
        run: |
          ./format.sh
          git diff

      - name: Check for changes
        run: "[ $(git status --porcelain | wc -l) -eq 0 ]"