From 47fff37fe70c7180ec1708a56f8e65f420fc97f0 Mon Sep 17 00:00:00 2001 From: Guus van der Meer Date: Mon, 25 Dec 2023 20:59:59 +0100 Subject: [PATCH 1/3] Added action that forces prettier to be run --- .github/workflows/prettier.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) 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 From 9d9d3f4070e29b27420333dce694ae464af98c86 Mon Sep 17 00:00:00 2001 From: Guus van der Meer Date: Mon, 25 Dec 2023 21:04:27 +0100 Subject: [PATCH 2/3] prettier run --- src/data/menu/index.html | 27 ++++++++++++++++++--------- src/data/menu/script.js | 26 ++++++++++++++++---------- src/data/menu/style.css | 5 +++-- 3 files changed, 37 insertions(+), 21 deletions(-) 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

- - - + + +