Skip to content

docs: updates resources section with newer content #1248

docs: updates resources section with newer content

docs: updates resources section with newer content #1248

Workflow file for this run

name: Check docs links
on:
pull_request:
paths:
- 'README.md'
- 'docs/content/**.md'
- '.github/workflows/check-links-pr.yaml'
branches:
- 'main'
jobs:
links-checker:
runs-on: ubuntu-latest
env:
PATCH_FILE: "additions.patch"
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
with:
hugo-version: '0.126.2'
extended: true
- name: Retrieve additions and replace GitHub main links with local branch
shell: bash
run: |
REPO=${{ github.event.pull_request.head.repo.full_name }}
BRANCH=${{ github.event.pull_request.head.ref }}
git diff -U0 origin/${{ github.base_ref }} -- docs/content README.md | { grep ^\+[^+] || true; } > $PATCH_FILE
sed -i "s#/cilium/tetragon/tree/main#/$REPO/tree/$BRANCH#g" $PATCH_FILE
sed -i "s#/cilium/tetragon/blob/main#/$REPO/blob/$BRANCH#g" $PATCH_FILE
sed -i "s#/cilium/tetragon/main#/$REPO/$BRANCH#g" $PATCH_FILE
- name: Serve the Hugo website
working-directory: docs
run: hugo server &
- name: Wait for server to be ready
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
timeout_seconds: 2
max_attempts: 10
retry_wait_seconds: 3
command: |
set -e
curl -s http://localhost:1313 > /dev/null
- name: Check new links
id: lychee
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1.10.0
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: --config .github/lychee.toml --base http://localhost:1313 $PATCH_FILE
fail: true