From 017bc03999266d215a07ba026ffd219bf12d54dd Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Sun, 10 Nov 2024 20:07:24 +0800 Subject: [PATCH] Update and rename formatter.yml to prettier.yml --- .github/workflows/formatter.yml | 22 ---------------------- .github/workflows/prettier.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/formatter.yml create mode 100644 .github/workflows/prettier.yml diff --git a/.github/workflows/formatter.yml b/.github/workflows/formatter.yml deleted file mode 100644 index 3310cebfc..000000000 --- a/.github/workflows/formatter.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Formatter -on: - push: - branches: - - main -jobs: - format: - name: "Format" - runs-on: ubuntu-latest - steps: - - uses: actions/setup-node@v4 - with: - node-version: 20.x - - name: Run prettier - # Use -y, like npm install -y - run: npx -y prettier ./domains -w --tab-width 2 --print-width 120 - - name: Commit - run: | - git config --global user.name 'is-a.dev' - git config --global user.email 'actions@github.com' - git commit -am "Format domains" - git push diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 000000000..8f494707a --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,27 @@ +name: Prettier + +on: + push: + branches: [main] + paths: + - "domains/*" + +jobs: + format: + name: Format + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Run Prettier + run: npx -y prettier ./domains -w --tab-width 2 --print-width 120 + + - name: Commit + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git commit -am "Format domains" + git push