forked from linux/documentation
53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
name: Fix Markdown typos
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "**/*.md"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
fix-typos:
|
|
runs-on: ubuntu-latest-intranet
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Fix Markdown typos
|
|
uses: actions/typos@v1.50.3
|
|
with:
|
|
files: "**/*.md"
|
|
write_changes: true
|
|
|
|
- name: Check for typo fixes
|
|
id: changes
|
|
run: |
|
|
if git diff --quiet; then
|
|
echo "No typo fixes needed."
|
|
echo "changed=false" >> "${GITHUB_OUTPUT}"
|
|
else
|
|
echo "changed=true" >> "${GITHUB_OUTPUT}"
|
|
fi
|
|
|
|
- name: Commit to branch and push fixes
|
|
if: steps.changes.outputs.changed == 'true'
|
|
run: |
|
|
git checkout -B typos
|
|
|
|
git config user.name "typos-bot"
|
|
git config user.email "typos-bot@localhost"
|
|
|
|
git add .
|
|
git commit -m "fix: correct markdown typos"
|
|
git push origin typos --force
|
|
|
|
- name: Create pull request
|
|
if: steps.changes.outputs.changed == 'true'
|
|
uses: actions/pullrequest@main
|
|
with:
|
|
title: "Fix markdown typos"
|
|
body: "Automated typo fixes from crate-ci/typos."
|
|
head: typos
|