From b5e253230c741b8911e92d877ec5e7c294a976c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Thu, 24 Oct 2024 12:26:35 -0300 Subject: [PATCH 1/4] Changed prettier workflow to actually apply changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araújo --- .github/workflows/prettier.yml | 36 +++++++--------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 60446c8db359..84e6c87e6fd7 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -11,38 +11,16 @@ on: - main jobs: - check: + format: # available images: https://github.com/actions/runner-images#available-images runs-on: ubuntu-latest steps: - - name: Checkout 🛎️ + - name: Checkout code 🛎️ uses: actions/checkout@v4 - - name: Setup Node.js ⚙️ - uses: actions/setup-node@v4 - - name: Install Prettier 💾 - run: npm install --save-dev --save-exact prettier @shopify/prettier-plugin-liquid - - name: Prettier Check 🔎 - id: prettier - run: npx prettier . --check - - name: Create diff 📝 - # https://docs.github.com/en/actions/learn-github-actions/expressions#failure - if: ${{ failure() }} - run: | - npx prettier . --write - git diff -- . ':(exclude)package-lock.json' ':(exclude)package.json' > diff.txt - npm install -g diff2html-cli - diff2html -i file -s side -F diff.html -- diff.txt - - name: Upload html diff ⬆️ - id: artifact-upload - if: ${{ failure() && steps.prettier.conclusion == 'failure' }} - uses: actions/upload-artifact@v4 with: - name: HTML Diff - path: diff.html - retention-days: 7 - - name: Dispatch information to repository 🗣️ - if: ${{ failure() && steps.prettier.conclusion == 'failure' && github.event_name == 'pull_request' }} - uses: peter-evans/repository-dispatch@v2 + fetch-depth: 0 + - name: Run Prettier 💅🏽 + uses: AbdulRehman-1/pr-prettier@initial with: - event-type: prettier-failed-on-pr - client-payload: '{"pr_number": "${{ github.event.number }}", "artifact_url": "${{ steps.artifact-upload.outputs.artifact-url }}", "run_id": "${{ github.run_id }}"}' + only_changed: true + prettier_options: --write **/*.{css,html,js,json,md,scss,yaml,yml} From ed1e8b065e1fa36a7171066c8ad4fc707f08e1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Thu, 24 Oct 2024 13:29:43 -0300 Subject: [PATCH 2/4] Added support for liquid files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araújo --- .github/workflows/prettier.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 84e6c87e6fd7..8e3bb844eb1e 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -23,4 +23,5 @@ jobs: uses: AbdulRehman-1/pr-prettier@initial with: only_changed: true - prettier_options: --write **/*.{css,html,js,json,md,scss,yaml,yml} + prettier_options: --write **/*.{css,html,js,json,liquid,md,scss,yaml,yml} + prettier_plugins: "@shopify/prettier-plugin-liquid" From ef4453389fecf4ec5742e253ede934da81f8ae82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Thu, 28 Nov 2024 15:47:47 -0300 Subject: [PATCH 3/4] Updated action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araújo --- .github/workflows/prettier.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 8e3bb844eb1e..e2b4839b0b7c 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout code 🛎️ uses: actions/checkout@v4 with: - fetch-depth: 0 + ref: ${{ github.head_ref }} - name: Run Prettier 💅🏽 uses: AbdulRehman-1/pr-prettier@initial with: From 825b37a6319058d87d0fe28935fa3d286c720980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Thu, 28 Nov 2024 15:51:02 -0300 Subject: [PATCH 4/4] Updated checkout version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araújo --- .github/workflows/prettier.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index e2b4839b0b7c..35c17f72c6f8 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code 🛎️ - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 with: ref: ${{ github.head_ref }} - name: Run Prettier 💅🏽