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:
1 parent
6ebfb4914f
commit
23f15aecb9
6 files changed
+109
-10
No files matched your search
@@ -20,6 +20,8 @@ import {
|
||||
import type { ParsedGitHubContext } from "../github/context";
|
||||
import type { CommonFields, PreparedContext, EventData } from "./types";
|
||||
import { GITHUB_SERVER_URL } from "../github/api/config";
|
||||
import { detectPlatform } from "../platform/detector";
|
||||
import { getForgejoRunIndex } from "../forgejo/comment-logic";
|
||||
import { extractUserRequest } from "../utils/extract-user-request";
|
||||
export type { CommonFields, PreparedContext } from "./types";
|
||||
|
||||
@@ -525,7 +527,11 @@ Images from comments have been saved to disk. Paths are in the formatted content
|
||||
: "No description provided";
|
||||
|
||||
const entityType = eventData.isPR ? "pull request" : "issue";
|
||||
const jobUrl = `${GITHUB_SERVER_URL}/${context.repository}/actions/runs/${process.env.GITHUB_RUN_ID}`;
|
||||
const runIdentifier =
|
||||
detectPlatform() === "forgejo"
|
||||
? getForgejoRunIndex()
|
||||
: process.env.GITHUB_RUN_ID;
|
||||
const jobUrl = `${GITHUB_SERVER_URL}/${context.repository}/actions/runs/${runIdentifier}`;
|
||||
|
||||
let promptContent = `You were tagged on a GitHub ${entityType} via "${context.triggerPhrase}". Read the request and decide how to help.
|
||||
|
||||
@@ -624,6 +630,10 @@ export function generateDefaultPrompt(
|
||||
const { eventData } = context;
|
||||
|
||||
const { eventType, triggerContext } = getEventTypeAndContext(context);
|
||||
const runIdentifier =
|
||||
detectPlatform() === "forgejo"
|
||||
? getForgejoRunIndex()
|
||||
: process.env.GITHUB_RUN_ID;
|
||||
|
||||
const formattedContext = formatContext(contextData, eventData.isPR);
|
||||
const formattedComments = formatComments(comments, imageUrlMap);
|
||||
@@ -831,7 +841,7 @@ ${
|
||||
- Display the todo list as a checklist in the GitHub comment and mark things off as you go.
|
||||
- REPOSITORY SETUP INSTRUCTIONS: The repository's CLAUDE.md file(s) contain critical repo-specific setup instructions, development guidelines, and preferences. Always read and follow these files, particularly the root CLAUDE.md, as they provide essential context for working with the codebase effectively.
|
||||
- Use h3 headers (###) for section titles in your comments, not h1 headers (#).
|
||||
- Your comment must always include the job run link in the format "[View job run](${GITHUB_SERVER_URL}/${context.repository}/actions/runs/${process.env.GITHUB_RUN_ID})" at the bottom of your response (branch link if there is one should also be included there).
|
||||
- Your comment must always include the job run link in the format "[View job run](${GITHUB_SERVER_URL}/${context.repository}/actions/runs/${runIdentifier})" at the bottom of your response (branch link if there is one should also be included there).
|
||||
|
||||
CAPABILITIES AND LIMITATIONS:
|
||||
When users ask you to do something, be aware of what you can and cannot do. This section helps you understand how to respond when users request actions outside your scope.
|
||||
|
||||
Reference in new issue
Block a user