From a4a71e7cbcf5a5d4dde0a53b6b7067e26f6cc83b Mon Sep 17 00:00:00 2001 From: "Jie.F" Date: Wed, 28 Aug 2024 16:30:36 +0800 Subject: [PATCH 1/2] add workflow to check link validation --- .github/workflows/check-links.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/check-links.yaml diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml new file mode 100644 index 000000000..e821a109f --- /dev/null +++ b/.github/workflows/check-links.yaml @@ -0,0 +1,28 @@ +name: Check Relative Links +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + check_links: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "20" + + - name: Install Markdown link checker + run: npm install -g markdown-link-check + + - name: Check links in Markdown files + run: | + find . -name "*.md" -print0 | xargs -0 markdown-link-check From 0185184197d9b91522607073037792ac8130a7b8 Mon Sep 17 00:00:00 2001 From: "Jie.F" Date: Thu, 29 Aug 2024 11:02:49 +0800 Subject: [PATCH 2/2] list failed links only --- .github/workflows/check-links.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index e821a109f..433f372b0 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -25,4 +25,4 @@ jobs: - name: Check links in Markdown files run: | - find . -name "*.md" -print0 | xargs -0 markdown-link-check + find . -name "*.md" -print0 | xargs -0 markdown-link-check --quiet