Skip to content

Commit 53a4f71

Browse files
authored
Update prettier.yml
1 parent 26b308c commit 53a4f71

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

.github/workflows/prettier.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,28 @@ jobs:
2121
uses: actions/setup-node@v4
2222
- name: Install Prettier 💾
2323
run: npm install --save-dev --save-exact prettier @shopify/prettier-plugin-liquid
24-
# - name: Prettier Check 🔎
25-
# id: prettier
26-
# run: npx prettier . --check
27-
# - name: Create diff 📝
28-
# # https://docs.github.com/en/actions/learn-github-actions/expressions#failure
29-
# if: ${{ failure() }}
30-
# run: |
31-
# npx prettier . --write
32-
# git diff -- . ':(exclude)package-lock.json' ':(exclude)package.json' > diff.txt
33-
# npm install -g diff2html-cli
34-
# diff2html -i file -s side -F diff.html -- diff.txt
35-
# - name: Upload html diff ⬆️
36-
# id: artifact-upload
37-
# if: ${{ failure() && steps.prettier.conclusion == 'failure' }}
38-
# uses: actions/upload-artifact@v4
39-
# with:
40-
# name: HTML Diff
41-
# path: diff.html
42-
# retention-days: 7
43-
# - name: Dispatch information to repository 🗣️
44-
# if: ${{ failure() && steps.prettier.conclusion == 'failure' && github.event_name == 'pull_request' }}
45-
# uses: peter-evans/repository-dispatch@v2
46-
# with:
47-
# event-type: prettier-failed-on-pr
48-
# client-payload: '{"pr_number": "${{ github.event.number }}", "artifact_url": "${{ steps.artifact-upload.outputs.artifact-url }}", "run_id": "${{ github.run_id }}"}'
24+
- name: Prettier Check 🔎
25+
id: prettier
26+
run: npx prettier . --check
27+
- name: Create diff 📝
28+
# https://docs.github.com/en/actions/learn-github-actions/expressions#failure
29+
if: ${{ failure() }}
30+
run: |
31+
npx prettier . --write
32+
git diff -- . ':(exclude)package-lock.json' ':(exclude)package.json' > diff.txt
33+
npm install -g diff2html-cli
34+
diff2html -i file -s side -F diff.html -- diff.txt
35+
- name: Upload html diff ⬆️
36+
id: artifact-upload
37+
if: ${{ failure() && steps.prettier.conclusion == 'failure' }}
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: HTML Diff
41+
path: diff.html
42+
retention-days: 7
43+
- name: Dispatch information to repository 🗣️
44+
if: ${{ failure() && steps.prettier.conclusion == 'failure' && github.event_name == 'pull_request' }}
45+
uses: peter-evans/repository-dispatch@v2
46+
with:
47+
event-type: prettier-failed-on-pr
48+
client-payload: '{"pr_number": "${{ github.event.number }}", "artifact_url": "${{ steps.artifact-upload.outputs.artifact-url }}", "run_id": "${{ github.run_id }}"}'

0 commit comments

Comments
 (0)