This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 105
83 lines (72 loc) · 2.37 KB
/
broken-link-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This is a basic workflow to help you get started with Actions
name: Broken Link Checker
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
check_html_links_job:
runs-on: ubuntu-latest
name: Check-Links-Action
steps:
- uses: actions/checkout@v4
name: Checkout Azure/azure-sdk-for-java
with:
repository: 'Azure/azure-sdk-for-java'
path: 'azure-sdk-for-java'
ref: main
fetch-depth: 0
token: ${{ secrets.ACCESS_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'oracle'
cache: maven
- name: Build latest azure-sdk-for-java repository
run: |
cd azure-sdk-for-java
mvn clean install \
-Dcheckstyle.skip=true \
-Dcodesnippet.skip \
-Denforcer.skip \
-Djacoco.skip=true \
-Dmaven.javadoc.skip=true \
-Drevapi.skip=true \
-DskipTests \
-Dspotbugs.skip=true \
-Pdev -T 4 -ntp -f sdk/spring/pom.xml
- uses: actions/checkout@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Build Docs
run: |
./mvnw clean install -P docs -pl docs -DskipTests
- name: Check link in generated html files
id: html-link-report
uses: peter-evans/link-checker@v1
with:
args: -d --document-root ./docs/target/generated-docs -r -x "https://my.custom.endpoint.com:55300|localhost"
- name: Replace bata to main in html-link-report result
run: |
if [ -d "link-checker/" ] ; then
cd link-checker
sudo sed -i 's/spring-cloud-azure_*.*.*-beta.[0-9]/main/g' *
sudo sed -i 's/```/ /g' *
sudo mv out.md ../
fi
- name: Remove files generated at build-time.
run: |
./mvnw clean
- name: Check link in all markdown files
uses: gaurav-nelson/[email protected]
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.github/workflows/markdown-link-check-config.json'