Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Update broken-link-check.yml #183

Update broken-link-check.yml

Update broken-link-check.yml #183

# 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@v3
name: Checkout Azure/azure-sdk-for-java
with:
repository: Azure/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: |
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@v3
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'