Skip to content

Commit 9028d70

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

File tree

4 files changed

+64
-5
lines changed

4 files changed

+64
-5
lines changed
Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,68 @@
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: Get list of changed Markdown files
33+
id: changed-files
34+
run: |
35+
git diff --name-only upstream/"${{ github.event.pull_request.base.ref }}...${{ github.head_ref }}" -- "*.md" > changed-files.txt
36+
cat changed-files.txt
37+
if [[ -s "changed-files.txt" ]]; then
38+
echo "Changed md files found"
39+
echo "foundFiles=true" >> "${GITHUB_ENV}"
40+
fi
41+
42+
- name: Switch to PR branch
43+
run: git checkout ${{ github.head_ref }}
44+
45+
- name: Check links in changed files
46+
if: env.foundFiles == 'true'
47+
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 # v2.2.0
48+
with:
49+
failIfEmpty: false
50+
args: |
51+
--no-progress
52+
--github-token "${GITHUB_TOKEN}"
53+
$(cat changed-files.txt | tr '\n' ' ')
54+
55+
- name: Provide helpful failure message
56+
if: failure()
57+
run: |
58+
echo "::error::Link check failed! Please review the broken links reported above."
59+
echo ""
60+
echo "If certain links are valid but fail due to:"
61+
echo "- CAPTCHA challenges"
62+
echo "- IP blocking"
63+
echo "- Authentication requirements"
64+
echo "- Rate limiting"
65+
echo ""
66+
echo "Consider adding them to .lycheeignore to bypass future checks."
67+
echo "Format: Add one URL pattern per line"
68+
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)