-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathupdate-available-internal-links-cursor-rule.yml
More file actions
60 lines (49 loc) · 2.23 KB
/
update-available-internal-links-cursor-rule.yml
File metadata and controls
60 lines (49 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Update available-internal-links cursor rule
on:
schedule:
- cron: "0 1 * * *" # Runs daily at 1am UTC
workflow_dispatch: # Allows manual triggering
jobs:
update-available-internal-links-cursor-rule:
runs-on: ubuntu-latest
environment: "main"
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.UPDATE_DOCS_MAIN_BRANCH_PAT }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: "9.5.0"
- name: Install dependencies
run: pnpm install
- name: Build sitemap and generate llms.txt
run: pnpm run build
# The llms.txt generation happens automatically as part of the postbuild process
- name: Append llms.txt to available-internal-links cursor rule
run: |
# Find the line number where "// Start of LLMs.txt" appears
LINE_NUM=$(grep -n "// Start of LLMs.txt" .cursor/rules/available-internal-links.mdc | cut -d: -f1)
if [ -n "$LINE_NUM" ]; then
# Keep the file content up to that line
head -n $LINE_NUM .cursor/rules/available-internal-links.mdc > temp_file
echo "" >> temp_file # Add a blank line after the marker
# Filter the llms.txt content - replace absolute links with relative ones
cat public/llms.txt | sed 's|https://langfuse.com||g' >> temp_file
mv temp_file .cursor/rules/available-internal-links.mdc
echo "Successfully appended llms.txt content to available-internal-links.mdc with relative links"
else
echo "Could not find '// Start of LLMs.txt' marker in available-internal-links.mdc"
exit 1
fi
- name: Commit and push if changed
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add .cursor/rules/available-internal-links.mdc
git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update available-internal-links.mdc" && git push origin ${GITHUB_REF#refs/heads/})