Skip to content

Commit

Permalink
fix: update octokit method calls to use the rest API
Browse files Browse the repository at this point in the history
Migrated to octokit.rest for users, repos, and issues methods.
  • Loading branch information
gentlementlegen committed Oct 31, 2024
1 parent 72b2b99 commit 48ea9d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/generate-permits-from-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function generatePermitsFromContext() {

async function returnDataToKernel(repoToken: string, stateId: string, output: object) {
const octokit = new Octokit({ auth: repoToken });
await octokit.repos.createDispatchEvent({
await octokit.rest.repos.createDispatchEvent({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
event_type: "return_data_to_ubiquibot_kernel",
Expand All @@ -93,7 +93,7 @@ async function handleSlashCommands(context: Context, octokit: Octokit) {
const address = matches[0];
// try registering wallet, if it fails, notify the user
if (!(await registerWallet(context, address))) {
await octokit.issues.createComment({
await octokit.rest.issues.createComment({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
issue_number: payload.issue.number,
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/generate-erc20-permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function generateErc20PermitSignature(
const config = contextOrPayload.config;
logger = contextOrPayload.logger;
const { evmNetworkId: configEvmNetworkId, evmPrivateEncrypted: configEvmPrivateEncrypted } = config;
const { data: userData } = await contextOrPayload.octokit.users.getByUsername({ username: _username });
const { data: userData } = await contextOrPayload.octokit.rest.users.getByUsername({ username: _username });
if (!userData) {
throw new Error(`GitHub user was not found for id ${_username}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/generate-erc721-permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function generateErc721PermitSignature(
}
_organizationName = contextOrPermitPayload.payload.repository.owner.login;
_repositoryName = contextOrPermitPayload.payload.repository.name;
const { data: userData } = await contextOrPermitPayload.octokit.users.getByUsername({ username: _username });
const { data: userData } = await contextOrPermitPayload.octokit.rest.users.getByUsername({ username: _username });
if (!userData) {
throw new Error(`GitHub user was not found for id ${_username}`);
}
Expand Down

0 comments on commit 48ea9d9

Please sign in to comment.