Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const APP_ID = 37848;
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const EVENT_TYPE = process.env.INPUT_EVENT_TYPE;
const VERSION = process.env.INPUT_VERSION;
const { createAppAuth } = require("@octokit/auth-app");
const { Octokit } = require("@octokit/core");
const { paginateRest } = require("@octokit/plugin-paginate-rest");
const OctokitWithPagination = Octokit.plugin(paginateRest);
main();
async function main() {
try {
const octokit = new OctokitWithPagination({
auth: {
id: APP_ID,
privateKey: PRIVATE_KEY
},
authStrategy: createAppAuth
});
const installations = await octokit.paginate("GET /app/installations", {
mediaType: { previews: ["machine-man"] },
per_page: 100