From a1e8cf071f6cf8395d883610e01e4e58241ceb61 Mon Sep 17 00:00:00 2001 From: Guus van der Meer Date: Mon, 25 Dec 2023 21:09:59 +0100 Subject: [PATCH] Added action that forces prettier (#10583) --- .github/workflows/prettier.yml | 35 ++++++++++++++++++++++++++++++++++ src/data/menu/index.html | 27 +++++++++++++++++--------- src/data/menu/script.js | 26 +++++++++++++++---------- src/data/menu/style.css | 5 +++-- 4 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/prettier.yml diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 00000000..8c1fd0dc --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,35 @@ +name: Prettier + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + prettier: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: npm ci + + - name: Run Prettier + run: npm run prettier + + - name: Check for changes + id: changes + run: | + git diff --name-only --exit-code HEAD^ HEAD | grep -vE 'package-lock.json' + + - name: Fail if changes found + run: | + if [ -n "${{ steps.changes.outputs.stdout }}" ]; then + echo "There are changes after running Prettier. Please run Prettier locally and commit the changes."; + exit 1; + fi diff --git a/src/data/menu/index.html b/src/data/menu/index.html index 59439eb4..063b5331 100644 --- a/src/data/menu/index.html +++ b/src/data/menu/index.html @@ -27,16 +27,25 @@

example.com

- - - + + +