summaryrefslogtreecommitdiff
path: root/.github/workflows/format.yaml
blob: aeb81181e5bab50b9b26aad79d162a8c4a49502e (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
29
30
31
32
33
name: format

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  format:
    runs-on: ubuntu-latest

    steps:
      - name: checkout repository
        uses: actions/checkout@v3

      - name: setup node
        uses: actions/setup-node@v3

      - name: install prettier
        run: |
          npm install -g prettier

      - name: format
        run: |
          prettier --editorconfig -w --parser html ./**/*.njk
          prettier --editorconfig -w .

      - name: add and commit
        uses: EndBug/add-and-commit@v9
        with:
          default_author: github_actions
          message: "chore: format with prettier"