...
1name: Markdown (Fail Fast)
2
3on:
4 push:
5 pull_request:
6
7jobs:
8 changedfiles:
9 name: changed files
10 runs-on: ubuntu-latest
11 outputs:
12 md: ${{ steps.changes.outputs.md }}
13 steps:
14 - name: Checkout Repo
15 uses: actions/checkout@v4
16 with:
17 fetch-depth: 0
18 - name: Get changed files
19 id: changes
20 run: |
21 echo "md=$(git diff --name-only --diff-filter=ACMRTUXB origin/${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)" >> $GITHUB_OUTPUT
22
23 lint:
24 name: lint markdown files
25 runs-on: ubuntu-latest
26 needs: changedfiles
27 if: ${{needs.changedfiles.outputs.md}}
28 steps:
29 - name: Checkout Repo
30 uses: actions/checkout@v4
31 - name: Run linter
32 uses: docker://avtodev/markdown-lint:v1
33 with:
34 args: ${{needs.changedfiles.outputs.md}}
View as plain text