Skip to content

Internal - Global - Check external links #5686

Internal - Global - Check external links

Internal - Global - Check external links #5686

---
name: Internal - Global - Check external links
on:
workflow_dispatch:
schedule:
- cron: 0 3 * * *
pull_request:
paths:
- .github/workflows/internal_global_links.yml
env:
IS_SCHEDULE: ${{ (contains(github.head_ref, 'schedules/') || github.event_name == 'schedule') && 'true' || 'false' }}
jobs:
lint:
name: links-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Get Current Date
id: dateofday
run: echo "DATEOFDAY=$(date +%Y-%m-%d)" >> "$GITHUB_ENV"
- name: Restore lychee cache
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: .lycheecache
key: cache-lychee-${{ env.DATEOFDAY }}
- name: Link Checker
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
with:
fail: true
args: -c ./lychee-links.toml --cache --max-cache-age 1d . --verbose --no-progress '*.md' './**/*.md'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache links
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: .lycheecache
key: cache-lychee-${{ env.DATEOFDAY }}
- name: Create Issue From File
if: failure() && env.IS_SCHEDULE == 'true'
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
assignees: '@camunda/infraex-medic'
- name: Notify in Slack in case of failure
id: slack-notification
uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@193a21e1e56c9a65517a822224ac3b4ffa4d6ae4 # 1.5.9
if: failure() && env.IS_SCHEDULE == 'true'
with:
vault_addr: ${{ secrets.VAULT_ADDR }}
vault_role_id: ${{ secrets.VAULT_ROLE_ID }}
vault_secret_id: ${{ secrets.VAULT_SECRET_ID }}