Skip to content

Commit 1bfb5bf

Browse files
aditya520claude
andcommitted
fix(dev-hub): fix broken URLs, remove stale timestamps, harden github-script
- Fix Solana/Sui progressive disclosure URLs (add pull-integration/ segment) - Remove per-request Generated on timestamp from all route handlers (contradicts revalidate=false, latent CDN caching bug) - Move sitemap lastModified to module-level BUILD_DATE constant - Move remaining ${{ }} expressions in github-script to env/process.env Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 25b7353 commit 1bfb5bf

File tree

9 files changed

+26
-24
lines changed

9 files changed

+26
-24
lines changed

.github/workflows/update-llms-txt.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,18 @@ jobs:
430430
- name: Comment on PR
431431
if: steps.changed-files.outputs.significant == 'true'
432432
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
433+
env:
434+
AFFECTED_PRODUCTS: ${{ steps.changed-files.outputs.affected_products }}
435+
NEW_PRODUCT: ${{ steps.changed-files.outputs.new_product }}
436+
CHANGED_FILES: ${{ steps.changed-files.outputs.files }}
433437
with:
434438
script: |
435439
const noUpdate = process.env.no_update === 'true';
436-
const affectedRaw = '${{ steps.changed-files.outputs.affected_products }}';
440+
const affectedRaw = process.env.AFFECTED_PRODUCTS || '';
437441
const affectedProducts = affectedRaw.split(' ').filter(Boolean);
438-
const newProduct = '${{ steps.changed-files.outputs.new_product }}' === 'true';
442+
const newProduct = process.env.NEW_PRODUCT === 'true';
439443
const updatedProducts = (process.env.updated_products || '').split(',').filter(Boolean);
444+
const changedFiles = process.env.CHANGED_FILES || '';
440445
441446
const newProductWarning = newProduct
442447
? `\n> ⚠️ **New product directory detected.** Please check if the \`llms.txt\` routing hub needs a new entry.\n`
@@ -456,7 +461,7 @@ jobs:
456461
<summary>Files analyzed</summary>
457462
458463
\`\`\`
459-
${{ steps.changed-files.outputs.files }}
464+
${changedFiles}
460465
\`\`\`
461466
</details>`;
462467
} else if (noUpdate) {
@@ -471,7 +476,7 @@ jobs:
471476
<summary>Files analyzed</summary>
472477
473478
\`\`\`
474-
${{ steps.changed-files.outputs.files }}
479+
${changedFiles}
475480
\`\`\`
476481
</details>`;
477482
} else {
@@ -489,7 +494,7 @@ jobs:
489494
<summary>Files that triggered this update</summary>
490495
491496
\`\`\`
492-
${{ steps.changed-files.outputs.files }}
497+
${changedFiles}
493498
\`\`\`
494499
</details>`;
495500
}

apps/developer-hub/src/app/SKILL.md/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ These files use a tiered system: Start with product files below for curated quic
247247
- Pyth Pro streaming: [llms-price-feeds-pro.txt](https://docs.pyth.network/llms-price-feeds-pro.txt)
248248
- Entropy randomness: [llms-entropy.txt](https://docs.pyth.network/llms-entropy.txt)
249249
- Machine-readable index: [llms-manifest.json](https://docs.pyth.network/llms-manifest.json)
250-
- Solana integration: [solana guide](https://docs.pyth.network/price-feeds/core/use-real-time-data/solana)
251-
- Sui integration: [sui guide](https://docs.pyth.network/price-feeds/core/use-real-time-data/sui)
250+
- Solana integration: [solana guide](https://docs.pyth.network/price-feeds/core/use-real-time-data/pull-integration/solana)
251+
- Sui integration: [sui guide](https://docs.pyth.network/price-feeds/core/use-real-time-data/pull-integration/sui)
252252
- Contract addresses: [addresses](https://docs.pyth.network/price-feeds/core/contract-addresses)
253253
- Price feed IDs: [feed-ids](https://pyth.network/developers/price-feed-ids)
254254
- Example apps: [pyth-examples](https://github.com/pyth-network/pyth-examples)

apps/developer-hub/src/app/llms-entropy.txt/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ For complete documentation, fetch any page as plain markdown:
202202
`;
203203

204204
export function GET() {
205-
const content = CONTENT + `\nGenerated on: ${new Date().toISOString()}\n`;
206-
return new NextResponse(content, {
205+
return new NextResponse(CONTENT, {
207206
headers: {
208207
"Cache-Control": "public, max-age=3600",
209208
"Content-Type": "text/plain; charset=utf-8",

apps/developer-hub/src/app/llms-price-feeds-core.txt/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ For complete documentation, fetch any page as plain markdown:
203203
`;
204204

205205
export function GET() {
206-
const content = CONTENT + `\nGenerated on: ${new Date().toISOString()}\n`;
207-
return new NextResponse(content, {
206+
return new NextResponse(CONTENT, {
208207
headers: {
209208
"Cache-Control": "public, max-age=3600",
210209
"Content-Type": "text/plain; charset=utf-8",

apps/developer-hub/src/app/llms-price-feeds-pro.txt/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ For complete documentation, fetch any page as plain markdown:
230230
`;
231231

232232
export function GET() {
233-
const content = CONTENT + `\nGenerated on: ${new Date().toISOString()}\n`;
234-
return new NextResponse(content, {
233+
return new NextResponse(CONTENT, {
235234
headers: {
236235
"Cache-Control": "public, max-age=3600",
237236
"Content-Type": "text/plain; charset=utf-8",

apps/developer-hub/src/app/llms-price-feeds.txt/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ For an opinionated, step-by-step integration guide:
6565
`;
6666

6767
export function GET() {
68-
const content = CONTENT + `\nGenerated on: ${new Date().toISOString()}\n`;
69-
return new NextResponse(content, {
68+
return new NextResponse(CONTENT, {
7069
headers: {
7170
"Cache-Control": "public, max-age=3600",
7271
"Content-Type": "text/plain; charset=utf-8",

apps/developer-hub/src/app/llms.txt/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ Programmatic discovery with token counts and content hashes:
5454
`;
5555

5656
export function GET() {
57-
const content = CONTENT + `\nGenerated on: ${new Date().toISOString()}\n`;
58-
return new NextResponse(content, {
57+
return new NextResponse(CONTENT, {
5958
headers: {
6059
"Cache-Control": "public, max-age=86400",
6160
"Content-Type": "text/plain; charset=utf-8",

apps/developer-hub/src/app/sitemap.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@ import type { MetadataRoute } from "next";
33
import { LLM_FILES } from "../data/llm-files";
44
import { source } from "../lib/source";
55

6+
const BUILD_DATE = new Date();
7+
68
export default function sitemap(): MetadataRoute.Sitemap {
79
const baseUrl = "https://docs.pyth.network";
810

911
const docPages = source.getPages().map((page) => ({
1012
changeFrequency: "weekly" as const,
11-
lastModified: new Date(),
13+
lastModified: BUILD_DATE,
1214
url: `${baseUrl}${page.url}`,
1315
}));
1416

1517
const llmPages = LLM_FILES.filter((f) => !f.deprecated).map((f) => ({
1618
changeFrequency: f.changeFrequency,
17-
lastModified: new Date(),
19+
lastModified: BUILD_DATE,
1820
url: `${baseUrl}${f.path}`,
1921
}));
2022

2123
const manifestPage = {
2224
changeFrequency: "weekly" as const,
23-
lastModified: new Date(),
25+
lastModified: BUILD_DATE,
2426
url: `${baseUrl}/llms-manifest.json`,
2527
};
2628

apps/developer-hub/src/data/llm-token-counts.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
"tokens": 177
3232
},
3333
"/SKILL.md": {
34-
"bytes": 10559,
35-
"hash": "sha256:0244c601968f346ca28d40c670a8ae305cbc866b203255c212f7b3cfdaf76c15",
36-
"tokens": 2882
34+
"bytes": 10593,
35+
"hash": "sha256:fbae9126d0824d624f37cbe56e4f0a09dc464e736069c0675232a254daa358af",
36+
"tokens": 2890
3737
}
3838
},
39-
"generated_at": "2026-02-16T19:29:20.225Z",
39+
"generated_at": "2026-02-16T19:49:45.026Z",
4040
"tokenizer": "cl100k_base",
4141
"tokenizer_note": "Token counts are approximate. Actual counts vary by model."
4242
}

0 commit comments

Comments
 (0)