fix: use GITHUB_RUN_NUMBER for Forgejo job URLs and pin Bun version in CI

Forgejo uses the per-repo sequential run index (GITHUB_RUN_NUMBER) in
action URLs, not the internal DB run ID (GITHUB_RUN_ID). This caused
"View job" links to return 404. Fixed in all 4 URL construction sites:
create-initial comment, update-comment-link, and both prompt generators.

Also pins Bun to 1.2.21 in CI — Bun 1.3.9 broke spyOn(fs, ...) which
failed 18 upstream image-downloader tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vlad MocanuandClaude Opus 4.6 committed 2026-02-25 21:07:40 +02:00
1 parent 6ebfb4914f
commit 23f15aecb9
6 files changed
+109 -10

No files matched your search

+18
View File
@@ -34,6 +34,24 @@ function getServerUrl(): string {
return process.env.GITHUB_SERVER_URL || "https://github.com";
}
// ---------------------------------------------------------------------------
// Run index helper
// ---------------------------------------------------------------------------
/**
* Get the run identifier for Forgejo URLs.
*
* Forgejo uses the per-repo sequential run index in URLs (`/actions/runs/{index}`),
* not the internal database run ID. The Forgejo runner sets:
* - GITHUB_RUN_ID = internal DB primary key (e.g. 11943)
* - GITHUB_RUN_NUMBER = per-repo sequential index (e.g. 661)
*
* GitHub uses GITHUB_RUN_ID in URLs, but Forgejo uses GITHUB_RUN_NUMBER.
*/
export function getForgejoRunIndex(): string {
return process.env.GITHUB_RUN_NUMBER || process.env.GITHUB_RUN_ID || "0";
}
// ---------------------------------------------------------------------------
// Spinner
// ---------------------------------------------------------------------------