Add Quickstart #4
This file contains 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: Format and Lint with Ruff and MarkdownLint | |
on: | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install ruff | |
# Update output format to enable automatic inline annotations. | |
- name: Run Ruff | |
run: | | |
ruff check --fix --output-format=github render_engine_markdown | |
ruff format render_engine_markdown | |
- name: Markdown Lint base-files | |
uses: DavidAnson/markdownlint-cli2-action@v14 | |
with: | |
fix: true | |
globs: | | |
*.md | |
.github/**/*.md | |
continue-on-error: true | |
- name: Markdown Lint Docs | |
uses: DavidAnson/markdownlint-cli2-action@v14 | |
with: | |
fix: true | |
globs: docs/**/*.md | |
config: docs/.markdownlint.json | |
continue-on-error: true | |
- name: Commit changes | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git config --global user.name "Ruff" | |
git config --global user.email "[email protected]" | |
git add -A | |
git commit -m "Format and lint with Ruff" | |
git push origin HEAD:${{ github.event.pull_request.head.ref }} | |
fi | |