feat: initial version #6
Workflow file for this run
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
--- | |
# lint all markdown files | |
name: "CI" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
types: | |
- opened | |
- synchronize | |
- reopened | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
markdownlint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install markdownlint-cli | |
run: | | |
npm install -g markdownlint-cli | |
- name: Lint markdown files | |
run: | | |
markdownlint \ | |
-f \ | |
-o markdownlint_report.log \ | |
'**/*.md' | |
- name: Print diff | |
if: failure() | |
run: | | |
echo "### Linting report:" >> $GITHUB_STEP_SUMMARY | |
cat markdownlint_report.log >> $GITHUB_STEP_SUMMARY | |
echo "### Suggested changes:" >> $GITHUB_STEP_SUMMARY | |
echo '```diff' >> $GITHUB_STEP_SUMMARY | |
echo "$(git diff)" >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY |