How to use @octokit/auth-app - 2 common examples

To help you get started, we’ve selected a few @octokit/auth-app examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HewlettPackard / yoda / nodejs / yoda-webhook / github-app.js View on Github external
function init() {
	logger.info("Initializing GitHub App ...");

	var pem = fs.readFileSync(configuration.getOption("app-pemfile"));
	
	auth = createAppAuth({
		  id: configuration.getOption('app-appid'),
		  privateKey: pem,
		  clientId: configuration.getOption('app-clientid'),
		  clientSecret: configuration.getOption('app-clientsecret'),
		  request: request.defaults({
			  baseUrl: configuration.getOption('baseurl')
		  })  
	});
	
	logger.debug(auth);
}
github orbs-network / orbs-network-go / .circleci / marvin / github.js View on Github external
const fetch = require('node-fetch');
const { sprintf } = require('sprintf-js');
const { createAppAuth } = require("@octokit/auth-app");
const fs = require('fs');
const path = require('path');
const pathToMarvinPrivateKey = path.join(__dirname, 'marvin.pem');
const privateKey = fs.readFileSync(pathToMarvinPrivateKey, 'utf-8');

const auth = createAppAuth({
    id: process.env.MARVIN_APP_ID,
    privateKey,
    installationId: process.env.MARVIN_ORBS_INSTALLATION_ID,
    clientId: process.env.MARVIN_CLIENT_ID,
    clientSecret: process.env.MARVIN_CLIENT_SECRET
});

function secondsToHumanReadable(seconds) {
    var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600);
    var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);
    var numseconds = (((seconds % 31536000) % 86400) % 3600) % 60;
    let humanReadable = '';

    humanReadable += (numhours > 0) ? numhours + " hours " : '';
    humanReadable += (numminutes > 0) ? numminutes + " minutes " : '';
    humanReadable += (numseconds > 0) ? numseconds + " seconds " : '';

@octokit/auth-app

GitHub App authentication for JavaScript

MIT
Latest version published 16 days ago

Package Health Score

89 / 100
Full package analysis

Popular @octokit/auth-app functions