Skip to content

Commit e27d751

Browse files
committed
fix(sep-automation): prefer App auth over GITHUB_TOKEN
When both App credentials and GITHUB_TOKEN are provided, prefer App auth since it has the org-level permissions needed for team lookups. The workflow's GITHUB_TOKEN doesn't have access to org teams.
1 parent 3f070b3 commit e27d751

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tools/sep-automation/src/github/client.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ export class GitHubClient {
2626
this.owner = config.targetOwner;
2727
this.repo = config.targetRepo;
2828

29-
// Start with basic octokit - will be replaced if using App auth
30-
if (config.githubToken) {
29+
// Prefer App auth over token (App auth has better org-level permissions)
30+
if (config.appId && config.appPrivateKey) {
31+
// Placeholder - will be initialized in ensureInitialized() with App auth
32+
this.octokit = new Octokit();
33+
} else if (config.githubToken) {
3134
this.octokit = new Octokit({ auth: config.githubToken });
3235
this.initialized = true;
3336
} else {
34-
// Placeholder - will be initialized in ensureInitialized()
37+
// Placeholder - should not happen due to config validation
3538
this.octokit = new Octokit();
3639
}
3740
}

0 commit comments

Comments
 (0)