Skip to content

Update config.yaml

Update config.yaml #85

Workflow file for this run

---
name: CI
on:
push:
pull_request:
concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
markdown_lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: markdownlint-cli
uses: nosborn/github-action-markdown-cli@508d6cefd8f0cc99eab5d2d4685b1d5f470042c1 # v3.5.0
with:
config_file: ".markdownlintrc"
files: src
yaml_lint:
name: YAML Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: yamllint-cli
uses: "docker://pipelinecomponents/yamllint:latest"
with:
args: yamllint -c .yamllintrc .
frontmatter_lint:
name: Frontmatter YAML Lint
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint frontmatter in changed markdown
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: npm run --silent lint-frontmatter -- --annotations
line_endings:
name: Line Endings Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Check for CRLF line endings
run: |
echo "Checking for files with CRLF line endings..."
# Find all text files (excluding .git directory and node_modules)
files_with_crlf=$(find . -type f \
-not -path "./.git/*" \
-not -path "./node_modules/*" \
\( \
-name "*.md" -o -name "*.yml" -o -name "*.yaml" \
-o -name "*.json" -o -name "*.py" -o -name "*.sh" \
-o -name "*.js" -o -name "*.ts" \
\) \
-exec file {} \; | grep "CRLF" || true)
if [ -n "$files_with_crlf" ]; then
echo "❌ ERROR: Found files with CRLF line endings:"
echo "$files_with_crlf"
echo ""
echo "Please convert these files to use LF line endings."
echo "You can use: sed -i 's/\r$//' <file>"
echo "Or configure your editor to use LF line endings (see .editorconfig)"
exit 1
else
echo "✅ All files have correct LF line endings"
fi
yaml_validate:
name: YAML Config Validate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
# Need history for the new-page diff (PRs only); shallow is fine
# for push events but harmless to fetch full depth here.
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Validate referenced yaml configs
env:
# On pull_request events these populate the "newly-added page"
# check that forbids inline yaml on new device pages. Push events
# leave them empty, so the inline-yaml rule is skipped there.
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
# On failure the validator writes a markdown report here; the
# pr-validation-feedback workflow turns it into a REQUEST_CHANGES
# review on the PR.
VALIDATION_REPORT: ${{ github.workspace }}/validation-report.md
run: npm run --silent validate-yaml
- name: Record PR number for feedback
# Always (even on failure) so the follow-up workflow can resolve the
# PR — workflow_run payloads omit the PR number for forks.
if: always() && github.event_name == 'pull_request'
run: echo "${{ github.event.pull_request.number }}" > pr-number.txt
- name: Upload validation feedback
# Upload on every PR run. When the validator passes there is no
# report file (if-no-files-found: ignore) and only pr-number.txt is
# uploaded, which signals the feedback workflow to dismiss any stale
# review.
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: validation-report
path: |
pr-number.txt
validation-report.md
if-no-files-found: ignore
retention-days: 1
link_check:
name: External Link Check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Check external links in changed markdown
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: npm run --silent check-links -- --annotations