Skip to content

Commit 7e6a4c0

Browse files
authored
Fixup github-action-indexer example (#49)
Fix configuration and type issues in github-action-indexer example This PR addresses three small but important issues in the github-action-indexer example: * Add missing AUGMENT_API_URL environment variable to the GitHub Actions workflow, ensuring the indexer can connect to the correct API endpoint * Fix incorrect property reference from this.config.apiKey to this.config.apiToken in the incremental update logic * Remove readonly modifier from context property to allow reassignment when importing previous state during incremental updates These fixes ensure the example works correctly for both full and incremental indexing scenarios.
1 parent 20593b5 commit 7e6a4c0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/typescript-sdk/context/github-action-indexer/.github/workflows/index.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
run: npm run index
5353
env:
5454
AUGMENT_API_TOKEN: ${{ secrets.AUGMENT_API_TOKEN }}
55+
AUGMENT_API_URL: ${{ secrets.AUGMENT_API_URL }}
5556
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5657
STORAGE_TYPE: file
5758
# Branch-specific state path (automatically determined from GITHUB_REF)

examples/typescript-sdk/context/github-action-indexer/src/index-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const DEFAULT_MAX_FILES = 500;
1818

1919
export class IndexManager {
2020
private readonly github: GitHubClient;
21-
private readonly context: DirectContext;
21+
private context: DirectContext;
2222
private readonly config: IndexConfig;
2323
private readonly statePath: string;
2424

@@ -373,7 +373,7 @@ export class IndexManager {
373373
try {
374374
// Create a new context from the previous state
375375
this.context = await DirectContext.importFromFile(tempStateFile, {
376-
apiKey: this.config.apiKey,
376+
apiKey: this.config.apiToken,
377377
apiUrl: this.config.apiUrl,
378378
});
379379
} finally {

0 commit comments

Comments
 (0)