-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.74 KB
/
lint-and-format.yml
File metadata and controls
83 lines (73 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Lint and Format Markdown and YAML Files
on:
push:
branches: ["main"]
paths:
- "**/*.yml"
- "**/*.yaml"
- "**/*.md"
- ".prettierrc"
- ".prettierignore"
- "eslint.config.js"
- "package.json"
- ".github/workflows/lint-and-format.yml"
pull_request:
branches: ["main"]
paths:
- "**/*.yml"
- "**/*.yaml"
- "**/*.md"
- ".prettierrc"
- ".prettierignore"
- "eslint.config.js"
- "package.json"
- ".github/workflows/lint-and-format.yml"
workflow_dispatch:
permissions:
contents: read
jobs:
lint-and-format-markdown-and-yaml:
name: Lint and Format Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
cache: "npm"
node-version-file: "package.json"
- name: Lint and Format - Install dependencies
run: npm ci
- name: Lint and Format - Run YAML linting
run: npm run lint:yaml
- name: Lint and Format - Run Markdown linting
run: npm run lint:markdown
- name: Lint and Format - Check formatting
run: npm run format:check
- name: Lint and Format - Summary
if: always()
run: |
echo "## Lint and Format Check Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### ✅ Completed Checks:" >> $GITHUB_STEP_SUMMARY
echo "- YAML linting (GitHub Actions workflows)" >> $GITHUB_STEP_SUMMARY
echo "- Markdown linting (README files)" >> $GITHUB_STEP_SUMMARY
echo "- Code formatting consistency check" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🔧 Available Fix Commands:" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "# Fix linting issues automatically:" >> $GITHUB_STEP_SUMMARY
echo "npm run lint:fix" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "# Fix formatting issues automatically:" >> $GITHUB_STEP_SUMMARY
echo "npm run format" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "# Run all checks locally:" >> $GITHUB_STEP_SUMMARY
echo "npm run test:lint" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📋 Checked Files:" >> $GITHUB_STEP_SUMMARY
echo "- \`.github/workflows/*.yml\` (GitHub Actions)" >> $GITHUB_STEP_SUMMARY
echo "- \`**/README.md\` (Documentation)" >> $GITHUB_STEP_SUMMARY
echo "- All YAML and Markdown files for formatting" >> $GITHUB_STEP_SUMMARY