Skip to content

Commit 04c6c29

Browse files
Update editorconfig-check.yml
Signed-off-by: LUIZ HAMILTON ROBERTO DA SILVA <[email protected]>
1 parent 2f871d1 commit 04c6c29

1 file changed

Lines changed: 20 additions & 54 deletions

File tree

.github/workflows/editorconfig-check.yml

Lines changed: 20 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: EditorConfig Check
1+
name: EditorConfig Check [Report-Only]
22

33
on:
44
push:
@@ -38,21 +38,18 @@ permissions:
3838

3939
jobs:
4040
editorconfig-check:
41-
name: 🔍 EditorConfig Lint
41+
name: 🔍 EditorConfig Lint (Report-Only)
4242
runs-on: ubuntu-latest
4343
timeout-minutes: 15
4444

4545
env:
46-
# Enterprise compromise:
47-
# - PRs: report-only (never fail)
48-
# - develop pushes: report-only (never fail)
49-
# - main pushes: enforce (fail on violations)
50-
ALLOW_WARNINGS: ${{ (github.event_name == 'pull_request' || github.ref == 'refs/heads/develop') && 'true' || 'false' }}
46+
# REPORT-ONLY: never fail the workflow (even if violations exist)
47+
REPORT_ONLY: "true"
5148

5249
# Pin for deterministic installs
5350
EC_VERSION: "3.0.3"
5451

55-
# Output files
52+
# Output
5653
OUT_DIR: "editorconfig-reports"
5754
EC_OUTPUT: "ec-output.txt"
5855
EC_SUMMARY: "ec-summary.md"
@@ -73,9 +70,6 @@ jobs:
7370
set -euo pipefail
7471
7572
URL="https://github.com/editorconfig-checker/editorconfig-checker/releases/download/v${EC_VERSION}/ec-linux-amd64.tar.gz"
76-
echo "Downloading EditorConfig Checker v${EC_VERSION}..."
77-
echo "URL: ${URL}"
78-
7973
TMPDIR="$(mktemp -d)"
8074
curl -fsSL "${URL}" -o "${TMPDIR}/ec.tar.gz"
8175
@@ -85,13 +79,11 @@ jobs:
8579
BIN="$(find "${TMPDIR}/ec" -maxdepth 6 -type f \( -name 'ec-linux-amd64' -o -name 'ec' \) | head -n 1 || true)"
8680
if [[ -z "${BIN:-}" ]]; then
8781
echo "❌ Error: 'ec' binary not found after extraction."
88-
echo "Extracted contents:"
8982
find "${TMPDIR}/ec" -maxdepth 6 -print
9083
exit 1
9184
fi
9285
9386
sudo install -m 0755 "${BIN}" /usr/local/bin/ec
94-
echo "Installed:"
9587
/usr/local/bin/ec --version
9688
9789
- name: ▶️ Run EditorConfig Checker (capture output + exit code)
@@ -117,24 +109,15 @@ jobs:
117109
set -euo pipefail
118110
119111
EC_EXIT="${{ steps.ec.outputs.exit_code }}"
120-
121-
# Conventions:
122-
# 0 = clean
123-
# 1 = violations
124-
# other = tool/runtime failure
125112
if [[ "${EC_EXIT}" == "0" ]]; then
126113
echo "status=clean" >> "${GITHUB_OUTPUT}"
127-
exit 0
128-
fi
129-
130-
if [[ "${EC_EXIT}" == "1" ]]; then
114+
elif [[ "${EC_EXIT}" == "1" ]]; then
131115
echo "status=violations" >> "${GITHUB_OUTPUT}"
132-
exit 0
116+
else
117+
echo "status=tool_failure" >> "${GITHUB_OUTPUT}"
133118
fi
134119
135-
echo "status=tool_failure" >> "${GITHUB_OUTPUT}"
136-
137-
- name: 📋 Generate Markdown Summary (View Runs)
120+
- name: 📋 Publish Run Summary (View Runs)
138121
if: always()
139122
shell: bash
140123
run: |
@@ -147,7 +130,7 @@ jobs:
147130
EXIT_CODE="${{ steps.ec.outputs.exit_code }}"
148131
149132
{
150-
echo "## 🔍 EditorConfig Check"
133+
echo "## 🔍 EditorConfig Check (Report-Only)"
151134
echo
152135
echo "- **Workflow:** \`${{ github.workflow }}\`"
153136
echo "- **Event:** \`${{ github.event_name }}\`"
@@ -156,30 +139,30 @@ jobs:
156139
echo "- **EC version:** \`${EC_VERSION}\`"
157140
echo "- **Exit code:** \`${EXIT_CODE}\`"
158141
echo "- **Status:** \`${STATUS}\`"
159-
echo "- **Policy (ALLOW_WARNINGS):** \`${ALLOW_WARNINGS}\`"
142+
echo "- **REPORT_ONLY:** \`${REPORT_ONLY}\`"
160143
echo
161144
162145
if [[ "${STATUS}" == "tool_failure" ]]; then
163146
echo "❌ **Tool failure** — EditorConfig Checker did not run successfully."
164147
echo
165-
echo "**Output (top 80 lines):**"
148+
echo "**Output (top 120 lines):**"
166149
echo
167150
echo '```text'
168-
head -n 80 "${OUT_TXT}" || true
151+
head -n 120 "${OUT_TXT}" || true
169152
echo '```'
170153
echo
171154
echo "_Fix the workflow/tool invocation; results are not trustworthy._"
172155
173156
elif [[ "${STATUS}" == "violations" ]]; then
174-
echo "⚠️ **Violations detected**"
157+
echo "⚠️ **Violations detected** (report-only — workflow does not fail)"
175158
echo
176-
echo "**Output (top 80 lines):**"
159+
echo "**Output (top 120 lines):**"
177160
echo
178161
echo '```text'
179-
head -n 80 "${OUT_TXT}" || true
162+
head -n 120 "${OUT_TXT}" || true
180163
echo '```'
181164
echo
182-
echo "_Output truncated. Download artifact '${OUT_DIR}' for full details._"
165+
echo "_Output truncated. Download artifacts for full details._"
183166
184167
else
185168
echo "✅ **No violations detected.**"
@@ -200,27 +183,10 @@ jobs:
200183
if-no-files-found: warn
201184
retention-days: 30
202185

203-
- name: 🚫 Enforce Policy (never blocks PRs; enforce on main only)
186+
- name: ✅ Finalize (report-only mode never fails)
204187
if: always()
205188
shell: bash
206189
run: |
207190
set -euo pipefail
208-
209-
STATUS="${{ steps.policy.outputs.status }}"
210-
211-
if [[ "${ALLOW_WARNINGS}" == "true" ]]; then
212-
echo "ALLOW_WARNINGS=true -> report-only mode. Passing."
213-
exit 0
214-
fi
215-
216-
if [[ "${STATUS}" == "tool_failure" ]]; then
217-
echo "❌ Tool failure (workflow misconfig or runtime error). Failing."
218-
exit 1
219-
fi
220-
221-
if [[ "${STATUS}" == "violations" ]]; then
222-
echo "❌ EditorConfig violations detected. Failing."
223-
exit 1
224-
fi
225-
226-
echo "✅ No violations. Passing."
191+
echo "Report-only workflow: always passing regardless of violations."
192+
exit 0

0 commit comments

Comments
 (0)