diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index cc4ce55ef46..e28a92d32f4 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -18,7 +18,7 @@ jobs: env: PR_HEAD: ${{ github.event.pull_request.head.sha }} outputs: - md: ${{ steps.changes.outputs.md }} + files: ${{ steps.changes.outputs.files }} steps: - name: Checkout Repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -27,11 +27,17 @@ jobs: - name: Get changed files id: changes run: | - echo "md=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep .md$ | xargs)" >> $GITHUB_OUTPUT + files=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep .md$ | xargs) + + if [ -z "$files" ] && git diff --name-only $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep -q "package.json"; then + files="**/*.md" + fi + + echo "files=$files" >> $GITHUB_OUTPUT check-links: runs-on: ubuntu-latest needs: changedfiles - if: ${{needs.changedfiles.outputs.md}} + if: ${{needs.changedfiles.outputs.files}} steps: - name: Checkout Repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -46,5 +52,5 @@ jobs: npx --no -- markdown-link-check \ --verbose \ --config .github/workflows/check_links_config.json \ - ${{needs.changedfiles.outputs.md}} \ - || { echo "Check that anchor links are lowercase"; exit 1; } + ${{needs.changedfiles.outputs.files}} \ + || { echo "Check that anchor links are lowercase"; exit 1; } \ No newline at end of file