microsoft/hve-core

Public

mirrored from https://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
hve-core-v2.0.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/markdown-link-check.yml

61lines · modecode

1name: Markdown Link Check
2
3on:
4 workflow_call:
5 inputs:
6 soft-fail:
7 description: 'Whether to continue on broken links'
8 required: false
9 type: boolean
10 default: false
11
12permissions:
13 contents: read
14
15jobs:
16 markdown-link-check:
17 name: Check Markdown Links
18 runs-on: ubuntu-latest
19 permissions:
20 contents: read
21 steps:
22 - name: Checkout code
23 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
24 with:
25 persist-credentials: false
26
27 - name: Setup Node.js
28 uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.1.0
29 with:
30 node-version: '20'
31 cache: 'npm'
32
33 - name: Install dependencies
34 run: npm ci
35
36 - name: Create logs directory
37 shell: pwsh
38 run: |
39 New-Item -ItemType Directory -Force -Path logs | Out-Null
40
41 - name: Run markdown link check
42 id: link-check
43 shell: pwsh
44 run: |
45 & scripts/linting/Markdown-Link-Check.ps1
46 continue-on-error: ${{ inputs.soft-fail }}
47
48 - name: Upload markdown link check results
49 if: always()
50 uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4.4.3
51 with:
52 name: markdown-link-check-results
53 path: logs/markdown-link-check-results.json
54 retention-days: 30
55
56 - name: Check results and fail if needed
57 if: ${{ !inputs.soft-fail && steps.link-check.outcome == 'failure' }}
58 shell: pwsh
59 run: |
60 Write-Host "Markdown link check failed and soft-fail is false. Failing the job."
61 exit 1
62