@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 03:37 UTC

next
yml 99 lines 3.54 KB
Raw
1 name: Docs - Check Links
2
3 on:
4 pull_request:
5 paths:
6 - 'docs/**'
7 - 'ts/**'
8 - '.github/actions/setup-node-pnpm-bun/action.yml'
9 - '.github/workflows/docs-check-links.yml'
10 - 'mise.toml'
11 - 'mise.lock'
12 schedule:
13 # Nightly external-link sweep. HEAD/GET-checking every external URL is
14 # slow and depends on third-party uptime, so it never runs on the PR path.
15 - cron: '30 2 * * *'
16 workflow_dispatch:
17
18 concurrency:
19 group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
20 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21
22 permissions:
23 contents: read
24
25 jobs:
26 check-links:
27 runs-on: ubuntu-latest
28 defaults:
29 run:
30 working-directory: ./docs
31 permissions:
32 contents: read
33 issues: write
34
35 steps:
36 - name: Checkout repository
37 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
38
39 - name: Setup Node.js, pnpm, Bun
40 uses: ./.github/actions/setup-node-pnpm-bun
41
42 - name: Cache bun dependencies
43 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
44 with:
45 path: ~/.bun/install/cache
46 key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }}
47 restore-keys: |
48 ${{ runner.os }}-bun-
49
50 - name: Install dependencies
51 run: bun install
52
53 - name: Validate internal links
54 if: github.event_name == 'pull_request'
55 run: bun run lint:links
56
57 - name: Validate internal and external links
58 if: github.event_name != 'pull_request'
59 run: bun run lint:links:external
60
61 # A red scheduled run is invisible unless someone watches the Actions
62 # tab. File one tracking issue and leave it open until the cause is
63 # fixed; PR runs skip this because their failures are already visible.
64 - name: Open tracking issue on failure
65 if: failure() && github.event_name != 'pull_request'
66 continue-on-error: true
67 # Override the job-level `./docs` default: that path only exists after
68 # checkout, and a pre-checkout failure would otherwise leave the runner
69 # unable to start this shell, silently losing the alert.
70 working-directory: ${{ github.workspace }}
71 env:
72 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73 GH_REPO: ${{ github.repository }}
74 LABEL: docs-external-links-failure
75 RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
76 EVENT_NAME: ${{ github.event_name }}
77 run: |
78 gh label create "$LABEL" \
79 --color B60205 \
80 --description "Nightly docs external-link check is failing" 2>/dev/null || true
81
82 existing=$(gh issue list --label "$LABEL" --state open --limit 1 --json number --jq '.[0].number // empty')
83 if [ -n "$existing" ]; then
84 echo "Issue #$existing is already open for this failure; not filing a duplicate."
85 exit 0
86 fi
87
88 gh issue create \
89 --title "Nightly docs external-link check is failing" \
90 --label "$LABEL" \
91 --body "The scheduled \`Docs - Check Links\` external sweep failed.
92
93 - Run: $RUN_URL
94 - Trigger: \`$EVENT_NAME\`
95
96 The failing URLs are listed in the run log. External links only fail on
97 evidence they are dead (404/410, or repeated network errors), so this
98 usually means a linked page moved or was taken down — fix or remove the
99 link in \`docs/content\`."