From 43f4989bb1f7005cd61558d24cd3bce311f49a8c Mon Sep 17 00:00:00 2001 From: Jimmy Debe <91767824+jimstir@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:42:18 -0400 Subject: [PATCH] Fix Markdown Lint (#25) The linter was not checking any files. --- .github/workflows/markdown-lint.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 44b419e7a..be303189c 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -1,6 +1,7 @@ name: markdown-linting on: + push: branches: - '**' @@ -13,10 +14,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.base.ref }} + uses: actions/checkout@v2 + + - name: Get changed files + continue-on-error: true + run: | + echo "CHANGED_FILES<> $GITHUB_ENV + gh pr diff ${{ github.event.number }} --name-only | sed -e 's|$|,|' | xargs -i echo "{}" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Markdown Linter uses: DavidAnson/markdownlint-cli2-action@v15 with: - globs: '/*.md' + globs: ${{ env.CHANGED_FILES }}