Update Launch-Script-AutomaticMenu.ps1 #56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: EditorConfig Check | |
on: | |
push: | |
branches: [main, develop] | |
paths: | |
- '.editorconfig' | |
- '**/.editorconfig' | |
- '**/*' | |
pull_request: | |
branches: [main, develop] | |
paths: | |
- '.editorconfig' | |
- '**/.editorconfig' | |
- '**/*' | |
workflow_dispatch: | |
jobs: | |
editorconfig-check: | |
name: 🔍 EditorConfig Lint | |
runs-on: ubuntu-latest | |
env: | |
ALLOW_WARNINGS: false | |
steps: | |
- name: 📦 Checkout Repository | |
uses: actions/checkout@v4 | |
- name: 📥 Download EditorConfig Checker | |
shell: bash | |
run: | | |
wget -q https://github.com/editorconfig-checker/editorconfig-checker/releases/latest/download/ec-linux-amd64.tar.gz | |
mkdir ec-checker | |
tar -xzf ec-linux-amd64.tar.gz -C ec-checker | |
BIN=$(find ec-checker -type f -executable -name "ec*" | head -n 1) | |
if [ -n "$BIN" ]; then | |
chmod +x "$BIN" | |
sudo mv "$BIN" /usr/local/bin/ec | |
else | |
echo "❌ Error: ec binary not found after extraction" | |
exit 1 | |
fi | |
- name: ▶️ Run EditorConfig Checker | |
run: | | |
ec --version | |
ec --disable-logs 2>&1 | tee ec-output.txt || true | |
- name: 📋 Generate Markdown Summary | |
if: always() | |
shell: bash | |
run: | | |
echo "### 🔍 EditorConfig Check Summary" > ec-summary.md | |
if grep -q "^\[" ec-output.txt; then | |
echo "**Violations found:**" >> ec-summary.md | |
head -n 20 ec-output.txt >> ec-summary.md | |
echo "\n...output truncated..." >> ec-summary.md | |
else | |
echo "✅ No violations detected." >> ec-summary.md | |
fi | |
cat ec-summary.md >> $GITHUB_STEP_SUMMARY | |
- name: 📂 Upload Lint Results as Artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: editorconfig-lint-results | |
path: | | |
ec-output.txt | |
ec-summary.md | |
retention-days: 30 | |
- name: 🚫 Fail if Violations Exist and Not Allowed | |
if: always() | |
shell: bash | |
run: | | |
if [ "$ALLOW_WARNINGS" != "true" ] && grep -q "^\[" ec-output.txt; then | |
echo "❌ Failing the job due to EditorConfig violations." | |
exit 1 | |
fi |