@@ -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