Skip to content

Commit

Permalink
ci: check dead links in markdown files (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc authored May 28, 2024
1 parent bbe7341 commit 9374892
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/lint-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
push:
branches: ["main"]
paths:
- "*.md"
- "**/*.md"
- ".github/workflows/lint-markdown.yml"
pull_request:
branches: ["main"]
paths:
- "*.md"
- "**/*.md"
- ".github/workflows/lint-markdown.yml"
schedule:
- cron: "44 7 * * 2"

jobs:
lint:
Expand All @@ -23,3 +25,19 @@ jobs:
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: "**/*.md"

check-links:
name: Check Dead Links
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check Dead Link
uses: umbrelladocs/action-linkspector@v1
with:
# Use github-pr-review when triggered by a pull request; otherwise, use github-check
reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }}
# Check all files in the repository for schedule; otherwise, check only changed files
# filter_mode: ${{ github.event_name == 'schedule' && 'nofilter' || 'diff_context'}}
filter_mode: nofilter
fail_on_error: true
5 changes: 5 additions & 0 deletions .linkspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dirs:
- .
useGitIgnore: true
ignorePatterns:
- pattern: "^https://github.com/dependabot\\[bot\\]$"
4 changes: 2 additions & 2 deletions maa-cli/docs/en-US/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Except for the above subcommands, maa-cli also provides other subcommands:

More command usage can be viewed by `maa help`, and the usage of specific commands can be viewed by `maa help <command>`.

[config-core]: config.md#MaaCore-related-configurations
[custom-task]: config.md#custom-task
[config-core]: config.md#maacore-related-configurations
[custom-task]: config.md#custom-tasks

<!-- markdownlint-disable-file MD013 -->
2 changes: 1 addition & 1 deletion maa-cli/docs/zh-CN/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ maa-cli 默认会向标准误 (stderr) 输出日志。`--log-file` 选项可以

更多命令的使用方法可以通过 `maa help` 查看,具体命令的使用方法可以 通过 `maa help <command>` 查看。

[config-core]: config.md#MaaCore-相关配置
[config-core]: config.md#maacore-相关配置
[custom-task]: config.md#自定义任务

<!-- markdownlint-disable-file MD013 -->

0 comments on commit 9374892

Please sign in to comment.