Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions extensions/github/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,17 @@ export async function getOctokitGraphql(): Promise<graphql> {

return _octokitGraphql;
}

export async function assignIssueToSelf(owner: string, repo: string, issueNumber: number): Promise<void> {
try {
const octokit = await getOctokit();
await octokit.issues.addAssignees({
owner,
repo,
issue_number: issueNumber,
assignees: [(await octokit.users.getAuthenticated()).data.login]
});
} catch (err) {
throw new Error(`Failed to assign issue: ${err.message}`);
}
}