Skip to content

Bump k8s to v1.35 for pre-release test #584

Bump k8s to v1.35 for pre-release test

Bump k8s to v1.35 for pre-release test #584

Workflow file for this run

name: Check Links In Pull Requests
on:
pull_request:
types: [opened, edited, reopened, synchronize, ready_for_review]
workflow_call:
inputs:
upstream:
description: 'Upstream URL passed from the caller workflow'
required: true
type: string
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-links-pr:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Add upstream remote
run: |
if [[ -n "${{ inputs.upstream }}" ]]; then
upstreamurl="${{ inputs.upstream }}"
else
upstreamurl="https://github.com/metal3-io/project-infra.git"
fi
git remote add upstream "${upstreamurl}"
git fetch upstream
- name: Checkout base branch
run: git checkout "upstream/${{ github.event.pull_request.base.ref }}"
- name: Get list of changed Markdown files (without deletions)
id: changed-files
run: |
git diff --name-only --diff-filter=d "upstream/${{ github.event.pull_request.base.ref }}...${{ github.head_ref }}" -- "*.md" > changed-files.txt
cat changed-files.txt
if [[ -s "changed-files.txt" ]]; then
echo "Changed md files found"
echo "foundFiles=true" >> "${GITHUB_ENV}"
fi
- name: Switch to PR branch
run: git checkout ${{ github.head_ref }}
- name: Check links in changed files
if: env.foundFiles == 'true'
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
failIfEmpty: false
args: |
--user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Brave/131"
--root-dir "$(pwd)/"
--fallback-extensions "md"
--github-token "${{ secrets.GITHUB_TOKEN }}"
--max-concurrency 8
--max-retries 5
--retry-wait-time 10
--insecure
--exclude-all-private
--no-progress
$(cat changed-files.txt | tr '\n' ' ')
- name: Provide helpful failure message
if: failure()
run: |
echo "::error::Link check failed! Please review the broken links reported above."
echo ""
echo "If certain links are valid but fail due to:"
echo "- CAPTCHA challenges"
echo "- IP blocking"
echo "- Authentication requirements"
echo "- Rate limiting"
echo ""
echo "Consider adding them to .lycheeignore to bypass future checks."
echo "Format: Add one URL pattern per line"
exit 1