Skip to content

chore: Move inactive members to emeritus #7987

chore: Move inactive members to emeritus

chore: Move inactive members to emeritus #7987

Workflow file for this run

name: check-links
on:
push:
branches: [ main ]
paths:
- '**/*.md'
- '**/*.rst'
- '.github/workflows/check-links.yml'
- '.github/workflows/check_links_config.json'
pull_request:
paths:
- '**/*.md'
- '**/*.rst'
- '.github/workflows/check-links.yml'
- '.github/workflows/check_links_config.json'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
check-links:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'otelbot[bot]' }}
timeout-minutes: 15
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get changed markdown files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
**/*.md
**/*.rst
- name: Install markdown-link-check
if: steps.changed-files.outputs.any_changed == 'true'
run: npm install -g markdown-link-check@v3.12.2
- name: Check links on push to main
if: steps.changed-files.outputs.any_changed == 'true' && github.event_name == 'push'
run: |
markdown-link-check \
--verbose \
--config .github/workflows/check_links_config.json \
${{ steps.changed-files.outputs.all_changed_files }} \
|| { echo "Check that anchor links are lowercase"; exit 1; }
- name: Check new links only on pull requests
if: steps.changed-files.outputs.any_changed == 'true' && github.event_name == 'pull_request'
run: |
# Extract URLs only from added lines in the diff to avoid
# rate limiting when checking all links in large files like
# CHANGELOG.md. Only new/changed links are checked on PRs;
# pushes to main still check all links in changed files.
git diff "origin/${{ github.base_ref }}...HEAD" -- \
${{ steps.changed-files.outputs.all_changed_files }} \
| grep '^+' | grep -v '^+++' \
| grep -oP 'https?://[^\s\)\]\"'"'"'`>]+' \
| sort -u > /tmp/new_links.txt
if [ ! -s /tmp/new_links.txt ]; then
echo "No new links found in diff, skipping check"
exit 0
fi
echo "Checking $(wc -l < /tmp/new_links.txt) new links:"
cat /tmp/new_links.txt
# Write links as markdown so markdown-link-check can parse them
awk '{print "- <" $0 ">"}' /tmp/new_links.txt > /tmp/new_links.md
markdown-link-check \
--verbose \
--config .github/workflows/check_links_config.json \
/tmp/new_links.md \
|| { echo "Check that anchor links are lowercase"; exit 1; }