Skip to content

Commit

Permalink
Adding octokit to provide releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerby Keith Aquino authored and kuroji-fusky committed Jul 13, 2022
1 parent 7f4e506 commit b771daa
Show file tree
Hide file tree
Showing 4 changed files with 699 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/.env.local.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
GA=
GITHUB_TOKEN=
18 changes: 18 additions & 0 deletions app/src/pages/api/octokit-releases.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Octokit } from "octokit"
import { Endpoints } from "@octokit/types"

type ReleasesParams =
Endpoints["GET /repos/{owner}/{repo}/releases"]["parameters"]
type ReleasesResponse =
Endpoints["GET /repos/{owner}/{repo}/releases"]["response"]

export default async function rel(req: ReleasesParams, res: ReleasesResponse) {
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
})

await octokit.request("GET /repos/OpenFurs/searchpets/releases", {
owner: "OpenFurs",
repo: "searchpets",
})
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"url": "git+https://github.com/OpenFurs/searchpets.git"
},
"devDependencies": {
"concurrently": "^7.0.0"
"@octokit/types": "^6.39.0",
"concurrently": "^7.0.0",
"octokit": "^2.0.3"
}
}
Loading

0 comments on commit b771daa

Please sign in to comment.