Skip to content

Commit dee4dcb

Browse files
committed
Test PR link check settings
Signed-off-by: peppi-lotta <[email protected]>
1 parent fb88cf0 commit dee4dcb

File tree

4 files changed

+69
-5
lines changed

4 files changed

+69
-5
lines changed
Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,73 @@
1-
name: PR Check Links
1+
name: Check Links In Pull Requests
22

33
on:
44
pull_request:
55
types: [opened, edited, reopened, synchronize, ready_for_review]
6+
workflow_call:
7+
push:
8+
branches:
9+
- main
610

7-
permissions:
8-
contents: read
11+
permissions: {}
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
916

1017
jobs:
11-
check-pr-links:
12-
uses: metal3-io/project-infra/.github/workflows/pr-link-check.yml@main
18+
check-links-pr:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Clone repository
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
with:
25+
fetch-depth: 0
26+
ref: ${{github.event.pull_request.head.ref}}
27+
repository: ${{github.event.pull_request.head.repo.full_name}}
28+
29+
- name: Checkout base branch
30+
run: git checkout upstream/${{ github.event.pull_request.base.ref }}
31+
32+
- name: Add upstream remote
33+
run: |
34+
git remote add upstream https://github.com/metal3-io/metal3-docs.git
35+
git fetch upstream
36+
37+
- name: Get list of changed Markdown files
38+
id: changed-files
39+
run: |
40+
git diff --name-only upstream/"${{ github.event.pull_request.base.ref }}...${{ github.head_ref }}" -- "*.md" > changed-files.txt
41+
cat changed-files.txt
42+
if [[ -s "changed-files.txt" ]]; then
43+
echo "Changed md files found"
44+
echo "foundFiles=true" >> "${GITHUB_ENV}"
45+
fi
46+
47+
- name: Switch to PR branch
48+
run: git checkout ${{ github.head_ref }}
49+
50+
- name: Check links in changed files
51+
if: env.foundFiles == 'true'
52+
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 # v2.2.0
53+
with:
54+
failIfEmpty: false
55+
args: |
56+
--no-progress
57+
--github-token "${GITHUB_TOKEN}"
58+
$(cat changed-files.txt | tr '\n' ' ')
59+
60+
- name: Provide helpful failure message
61+
if: failure()
62+
run: |
63+
echo "::error::Link check failed! Please review the broken links reported above."
64+
echo ""
65+
echo "If certain links are valid but fail due to:"
66+
echo "- CAPTCHA challenges"
67+
echo "- IP blocking"
68+
echo "- Authentication requirements"
69+
echo "- Rate limiting"
70+
echo ""
71+
echo "Consider adding them to .lycheeignore to bypass future checks."
72+
echo "Format: Add one URL pattern per line"
73+
exit 1

docs/user-guide/src/capm3/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Kubernetes Cluster API Provider Metal3
22

3+
TEST
34
Kubernetes-native declarative infrastructure for Metal3.
45

56
<!-- markdownlint-disable no-inline-html -->

docs/user-guide/src/ipam/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# IPAM (IP Address Manager)
22

3+
TEST
34
The IPAM project provides a controller to manage static IP address allocations
45
in [Cluster API Provider Metal3](https://github.com/metal3-io/cluster-api-provider-metal3/).
56

docs/user-guide/src/version_support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Supported release versions
22

3+
TEST
34
The Cluster API Provider Metal3 (CAPM3) team maintains the two most recent minor
45
releases; older minor releases are immediately unsupported when a new
56
major/minor release is available. Test coverage will be maintained for all

0 commit comments

Comments
 (0)