mirror of
https://github.com/m3y54m/Embedded-Engineering-Roadmap.git
synced 2026-10-10 00:08:23 +03:00
ci: add link checker, README convention check and PR templat
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
name: Link check
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 6 * * 1"
|
||||
pull_request:
|
||||
paths:
|
||||
- "**/*.md"
|
||||
- ".github/lychee.toml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lychee:
|
||||
name: Check links
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check links
|
||||
id: lychee
|
||||
uses: lycheeverse/lychee-action@v2
|
||||
with:
|
||||
args: --config .github/lychee.toml --no-progress "**/*.md"
|
||||
output: lychee/out.md
|
||||
# Pull requests report broken links without blocking; scheduled runs fail and open an issue.
|
||||
fail: ${{ github.event_name != 'pull_request' }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Report broken links
|
||||
if: github.event_name != 'pull_request' && steps.lychee.outputs.exit_code != 0
|
||||
uses: peter-evans/create-issue-from-file@v5
|
||||
with:
|
||||
title: Link check report
|
||||
content-filepath: lychee/out.md
|
||||
labels: broken-links
|
||||
@@ -0,0 +1,33 @@
|
||||
name: Markdown lint
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
markdownlint:
|
||||
name: Markdown lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v19
|
||||
with:
|
||||
globs: "**/*.md"
|
||||
|
||||
readme-conventions:
|
||||
name: README conventions
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check entry format and duplicates
|
||||
run: python3 .github/scripts/check_readme.py
|
||||
@@ -1,32 +0,0 @@
|
||||
name: Static Analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
markdownlint:
|
||||
name: Markdown Lint Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
- name: Install markdownlint-cli
|
||||
run: npm install -g markdownlint-cli
|
||||
|
||||
- name: Run markdownlint
|
||||
run: |
|
||||
echo "🔍 Checking Markdown files..."
|
||||
if find . -name "*.md" -not -path "./node_modules/*" -not -path "./.git/*" | head -1 | grep -q .; then
|
||||
find . -name "*.md" -not -path "./node_modules/*" -not -path "./.git/*" -print0 | xargs -0 markdownlint --config .markdownlint.json || markdownlint **/*.md
|
||||
echo "✅ Markdown lint check completed successfully"
|
||||
else
|
||||
echo "ℹ️ No Markdown files found to check"
|
||||
fi
|
||||
Reference in New Issue
Block a user