async function isFirstTimeContributor()

in index.js [451:465]


async function isFirstTimeContributor(context) {
    try {
        const response = await context.octokit.issues.listForRepo(
            context.repo({
                state: 'all',
                creator: context.payload.pull_request.user.login
            })
        );
        return response.data.filter(data => data.pull_request).length === 1;
    }
    catch (e) {
        logger.error('failed to check first-time contributor');
        logger.error(e);
    }
}