From 3f51d449606a618a3004fc6b4174b6cfad35cf7a Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 11 Jun 2025 14:24:27 +0200 Subject: [PATCH] Add autofix job formatting text --- .github/workflows/autofix.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/autofix.yml diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml new file mode 100644 index 00000000..2b50f97c --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,41 @@ +name: autofix.ci # needed to securely identify the workflow + +on: + pull_request: + +permissions: + contents: read + +jobs: + # format-text and format-shell in one job to ensure we don't require multiple fix commits and CI re-runs + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + lfs: true + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + cache: 'yarn' + + - uses: actions/setup-go@v5 + with: + go-version: "oldstable" + + - name: Install shfmt + run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.11.0 + + - name: Install dependencies + run: yarn install --immutable --immutable-cache --check-cache + + - name: Format text + run: yarn format-text + + - name: Format shell + run: yarn format-shell + + # See https://autofix.ci/ + - uses: autofix-ci/action@v1