Skip to content

Commit

Permalink
chore: use octokit.rest
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Aug 14, 2024
1 parent 0509c64 commit 574d912
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/adapters/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Storage {
const { octokit, payload } = context;

try {
await octokit.repos.createOrUpdateFileContents({
await octokit.rest.repos.createOrUpdateFileContents({
owner: payload.repository.owner.login,
repo: "ubiquibot-config",
path: manifest.name + "-storage.json",
Expand All @@ -68,7 +68,7 @@ export class Storage {
async fetchStorage(context: Context) {
const { octokit, payload } = context;
try {
const { data } = await octokit.repos.getContent({
const { data } = await octokit.rest.repos.getContent({
owner: payload.repository.owner.login,
repo: "ubiquibot-config",
path: manifest.name + "-storage.json",
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function run() {

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 Down
2 changes: 1 addition & 1 deletion src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function logAndComment(context: Context, type: LogLevel, message: s
const log = logger[type](message, metadata);

if (log) {
await octokit.issues.createComment({
await octokit.rest.issues.createComment({
owner: payload.repository.owner.login,
repo: payload.repository.name,
issue_number: payload.issue.number,
Expand Down

0 comments on commit 574d912

Please sign in to comment.