File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Check for Broken Links
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+ push :
8+ branches :
9+ - main
10+ # Allow manual trigger
11+ workflow_dispatch :
12+
13+ jobs :
14+ check-links :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v4
20+
21+ - name : Setup Node.js
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : " 20"
25+
26+ - name : Install Mintlify CLI
27+ run : npm install -g mint
28+
29+ - name : Check for broken links
30+ run : mint broken-links
31+ continue-on-error : false
32+
33+ - name : Comment on PR (if failed)
34+ if : failure() && github.event_name == 'pull_request'
35+ uses : actions/github-script@v7
36+ with :
37+ script : |
38+ github.rest.issues.createComment({
39+ issue_number: context.issue.number,
40+ owner: context.repo.owner,
41+ repo: context.repo.repo,
42+ body: '❌ **Broken links detected!**\n\nPlease check the workflow logs for details on which links are broken and fix them before merging.'
43+ })
You can’t perform that action at this time.
0 commit comments