Skip to content

Commit b84d598

Browse files
Update prettier-check.yml
Signed-off-by: LUIZ HAMILTON ROBERTO DA SILVA <[email protected]>
1 parent e2a109c commit b84d598

1 file changed

Lines changed: 29 additions & 9 deletions

File tree

.github/workflows/prettier-check.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,52 @@ on:
2929

3030
jobs:
3131
prettier:
32-
name: Prettier Code Format Validation
32+
name: 💅 Prettier Code Format Validation
3333
runs-on: ubuntu-latest
3434

3535
steps:
3636
- name: 📦 Checkout Repository
37-
uses: actions/checkout@v4.2.2
37+
uses: actions/checkout@v4.1.1
3838

3939
- name: ⚙️ Setup Node.js
40-
uses: actions/setup-node@v4.0.3
40+
uses: actions/setup-node@v4
4141
with:
4242
node-version: '20'
4343
cache: 'npm'
4444

45-
- name: 📦 Install Dependencies from Lockfile
45+
- name: 📥 Install Dependencies from Lockfile
4646
run: npm ci
4747

4848
- name: 🔍 Run Prettier Check
4949
id: prettier
5050
run: |
51-
npx prettier --check . > prettier-report.txt || true
51+
echo "Running Prettier..."
52+
npx prettier --check . > prettier-report.txt 2>&1 || true
5253
53-
- name: 📊 Upload Prettier Report
54-
if: failure()
54+
- name: 📄 Generate GitHub Job Summary
55+
shell: bash
56+
run: |
57+
if grep -q "Code style issues found" prettier-report.txt; then
58+
echo "### 💅 Prettier Format Summary" >> $GITHUB_STEP_SUMMARY
59+
echo "❌ Code style issues detected. See artifact report for details." >> $GITHUB_STEP_SUMMARY
60+
else
61+
echo "### 💅 Prettier Format Summary" >> $GITHUB_STEP_SUMMARY
62+
echo "✅ No formatting issues found." >> $GITHUB_STEP_SUMMARY
63+
fi
64+
65+
- name: 📊 Upload Prettier Report Artifact
5566
uses: actions/upload-artifact@v4
5667
with:
57-
name: prettier-report
68+
name: prettier-format-report
5869
path: prettier-report.txt
5970
retention-days: 7
60-
71+
72+
- name: 💥 Fail if Prettier Violations Exist
73+
shell: bash
74+
run: |
75+
if grep -q "Code style issues found" prettier-report.txt; then
76+
echo "❌ Failing due to Prettier formatting violations."
77+
exit 1
78+
else
79+
echo "✅ No formatting issues. Passing."
80+
fi

0 commit comments

Comments
 (0)