Skip to content

Commit 9e07e6e

Browse files
author
Tulga Tsogtgerel
committed
sync
1 parent 5b70fa0 commit 9e07e6e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/auggie.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ export type RunAuggieOptions = {
99
apiKey?: string;
1010
apiUrl?: string;
1111
workspaceRoot?: string;
12+
githubToken?: string;
1213
};
1314

1415
/**
1516
* Run Auggie agent with the given prompt and return the response
1617
*/
1718
export async function runAuggie(options: RunAuggieOptions): Promise<string> {
18-
const { prompt, apiKey, apiUrl, workspaceRoot } = options;
19+
const { prompt, apiKey, apiUrl, workspaceRoot, githubToken } = options;
1920

2021
const workspace = workspaceRoot || process.cwd();
2122

@@ -25,6 +26,12 @@ export async function runAuggie(options: RunAuggieOptions): Promise<string> {
2526
let client: Auggie | null = null;
2627

2728
try {
29+
// Set GITHUB_API_TOKEN environment variable if provided
30+
if (githubToken) {
31+
process.env.GITHUB_API_TOKEN = githubToken;
32+
core.info("✅ GITHUB_API_TOKEN environment variable set");
33+
}
34+
2835
// Create Auggie client
2936
client = await Auggie.create({
3037
model: "sonnet4.5",
@@ -34,7 +41,7 @@ export async function runAuggie(options: RunAuggieOptions): Promise<string> {
3441
allowIndexing: true,
3542
});
3643

37-
core.info(`📝 Sending prompt to Auggie: ${prompt}`);
44+
core.info("📝 Sending prompt to Auggie...");
3845

3946
// Send prompt and get response
4047
const response = await client.prompt(prompt, { isAnswerOnly: true });

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ async function main(): Promise<void> {
108108
apiKey: augmentApiKey,
109109
apiUrl: augmentApiUrl,
110110
workspaceRoot: workspaceRoot || undefined,
111+
githubToken,
111112
});
112113

113114
// Get issue number for posting the response

0 commit comments

Comments
 (0)