Skip to content

Commit e2a109c

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

1 file changed

Lines changed: 28 additions & 95 deletions

File tree

.github/workflows/editorconfig-check.yml

Lines changed: 28 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -6,81 +6,13 @@ on:
66
paths:
77
- '.editorconfig'
88
- '**/.editorconfig'
9-
- '**/*.ps1'
10-
- '**/*.psm1'
11-
- '**/*.psd1'
12-
- '**/*.vbs'
13-
- '**/*.hta'
14-
- '**/*.xml'
15-
- '**/*.json'
16-
- '**/*.jsonc'
17-
- '**/*.md'
18-
- '**/*.rst'
19-
- '**/*.txt'
20-
- '**/*.csv'
21-
- '**/*.log'
22-
- '**/*.sh'
23-
- '**/*.bash'
24-
- '**/*.bat'
25-
- '**/*.cmd'
26-
- '**/*.html'
27-
- '**/*.yml'
28-
- '**/*.yaml'
29-
- '**/*.toml'
30-
- '**/*.ini'
31-
- '**/*.conf'
32-
- '**/*.config'
33-
- '**/*.nuspec'
34-
- '**/*.csproj'
35-
- '**/*.reg'
36-
- '**/*.env'
37-
- '**/.eslintrc'
38-
- '**/.eslintrc.json'
39-
- '**/.stylelintrc'
40-
- '**/.prettierrc'
41-
- '**/.prettierrc.json'
42-
- '**/*.lock'
43-
9+
- '**/*'
4410
pull_request:
4511
branches: [main, develop]
4612
paths:
4713
- '.editorconfig'
4814
- '**/.editorconfig'
49-
- '**/*.ps1'
50-
- '**/*.psm1'
51-
- '**/*.psd1'
52-
- '**/*.vbs'
53-
- '**/*.hta'
54-
- '**/*.xml'
55-
- '**/*.json'
56-
- '**/*.jsonc'
57-
- '**/*.md'
58-
- '**/*.rst'
59-
- '**/*.txt'
60-
- '**/*.csv'
61-
- '**/*.log'
62-
- '**/*.sh'
63-
- '**/*.bash'
64-
- '**/*.bat'
65-
- '**/*.cmd'
66-
- '**/*.html'
67-
- '**/*.yml'
68-
- '**/*.yaml'
69-
- '**/*.toml'
70-
- '**/*.ini'
71-
- '**/*.conf'
72-
- '**/*.config'
73-
- '**/*.nuspec'
74-
- '**/*.csproj'
75-
- '**/*.reg'
76-
- '**/*.env'
77-
- '**/.eslintrc'
78-
- '**/.eslintrc.json'
79-
- '**/.stylelintrc'
80-
- '**/.prettierrc'
81-
- '**/.prettierrc.json'
82-
- '**/*.lock'
83-
15+
- '**/*'
8416
workflow_dispatch:
8517

8618
jobs:
@@ -92,7 +24,7 @@ jobs:
9224

9325
steps:
9426
- name: 📦 Checkout Repository
95-
uses: actions/checkout@v4.1.1
27+
uses: actions/checkout@v4
9628

9729
- name: 📥 Download EditorConfig Checker
9830
shell: bash
@@ -110,38 +42,39 @@ jobs:
11042
fi
11143
11244
- name: ▶️ Run EditorConfig Checker
113-
id: ec-check
114-
shell: bash
11545
run: |
116-
echo "🔍 Running EditorConfig Checker..."
11746
ec --version
118-
if ec --disable-logs > ec-output.txt 2>&1; then
119-
echo "✅ No violations found."
120-
echo "passed=true" >> $GITHUB_OUTPUT
121-
else
122-
echo "⚠️ Violations found."
123-
echo "passed=false" >> $GITHUB_OUTPUT
124-
fi
47+
ec --disable-logs 2>&1 | tee ec-output.txt || true
12548
126-
- name: 📝 Generate GitHub Summary
49+
- name: 📋 Generate Markdown Summary
12750
if: always()
12851
shell: bash
12952
run: |
130-
echo "### 🧾 EditorConfig Check Summary" >> $GITHUB_STEP_SUMMARY
131-
echo "- Commit: [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_STEP_SUMMARY
132-
echo "- Branch: `${{ github.ref_name }}`" >> $GITHUB_STEP_SUMMARY
133-
echo "" >> $GITHUB_STEP_SUMMARY
134-
135-
if [ -f ec-output.txt ]; then
136-
echo '```' >> $GITHUB_STEP_SUMMARY
137-
head -n 100 ec-output.txt >> $GITHUB_STEP_SUMMARY
138-
echo '```' >> $GITHUB_STEP_SUMMARY
53+
echo "### 🔍 EditorConfig Check Summary" > ec-summary.md
54+
if grep -q "^\[" ec-output.txt; then
55+
echo "**Violations found:**" >> ec-summary.md
56+
head -n 20 ec-output.txt >> ec-summary.md
57+
echo "\n...output truncated..." >> ec-summary.md
13958
else
140-
echo "No output file found." >> $GITHUB_STEP_SUMMARY
59+
echo "No violations detected." >> ec-summary.md
14160
fi
61+
cat ec-summary.md >> $GITHUB_STEP_SUMMARY
62+
63+
- name: 📂 Upload Lint Results as Artifacts
64+
if: always()
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: editorconfig-lint-results
68+
path: |
69+
ec-output.txt
70+
ec-summary.md
71+
retention-days: 30
14272

14373
- name: 🚫 Fail if Violations Exist and Not Allowed
144-
if: steps.ec-check.outputs.passed == 'false' && env.ALLOW_WARNINGS != 'true'
74+
if: always()
75+
shell: bash
14576
run: |
146-
echo "❌ Failing the job due to EditorConfig violations."
147-
exit 1
77+
if [ "$ALLOW_WARNINGS" != "true" ] && grep -q "^\[" ec-output.txt; then
78+
echo "❌ Failing the job due to EditorConfig violations."
79+
exit 1
80+
fi

0 commit comments

Comments
 (0)