aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/formatters.yml
blob: 4df38b692a282a88240b7e933daad347eb016b8f (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
name: Changed formatters
on: [pull_request]
jobs:
  formatters:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout pull request
        uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0 # compare against main
      - name: Fetch master
        run: |
          git fetch
      - name: Test changed formatters
        run: |
          set -euo pipefail

          mkdir -p .tmp
          make docker CMD="make fmt-changed > .tmp/changed"
          export FORMATTERS="$(< .tmp/changed)"
          if [[ -n "${FORMATTERS}" ]]; then
              make fmt-build fmt-docker CMD="make fmt-test"
          fi