diff --git a/index.js b/index.js index 192fd89..a921245 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,6 @@ const core = require('@actions/core'); -const exec = require('@actions/exec'); const github = require('@actions/github'); const axios = require('axios'); -const path = require('path'); const githubToken = core.getInput('github-token', {required: true}) const exemptedBots = core.getInput('exempted-bots', {required: true}).split(',').map(input => input.trim()); @@ -27,14 +25,6 @@ function hasImplicitLicense(commit_message) { } async function run() { - // Install dependencies - core.startGroup('Installing python3-launchpadlib') - await exec.exec('sudo apt-get update'); - await exec.exec('sudo apt-get install python3-launchpadlib'); - core.endGroup() - - console.log(); - // Get existing contributors const ghRepo = github.getOctokit(githubToken); const accept_existing_contributors = (core.getInput('accept-existing-contributors') == "true"); @@ -130,35 +120,6 @@ async function run() { } } - console.log(); - - // Check Launchpad - for (const i in commit_authors) { - if (commit_authors[i]['signed'] == false) { - console.log('Checking the following user on Launchpad:'); - const email = commit_authors[i]['email']; - - await exec.exec('python3', [path.join(__dirname, 'lp_cla_check.py'), email], options = { - silent: true, - listeners: { - stdout: (data) => { - process.stdout.write(data.toString()); - }, - stderr: (data) => { - process.stdout.write(data.toString()); - } - } - }) - .then((result) => { - commit_authors[i]['signed'] = true; - }).catch((error) => { - commit_authors[i]['signed'] = false; - }); - } - } - - console.log(); - // Determine Result passed = true var non_signers = [] diff --git a/lp_cla_check.py b/lp_cla_check.py deleted file mode 100755 index 61aa43d..0000000 --- a/lp_cla_check.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import sys -import argparse -from launchpadlib.launchpad import Launchpad - -def lp_email_check(email, lp, cla_members): - user = lp.people.getByEmail(email=email) - if not user: - print('- ' + email + ' ✕ (has no Launchpad account)') - return False - if user in cla_members: - print('- ' + email + ' ✓ (has signed the CLA)') - return True - else: - print('- ' + email + ' ✕ (has not signed the CLA)') - return False - -def main(): - parser = argparse.ArgumentParser(description="") - parser.add_argument( - "email", help="Email address to verify" - ) - opts = parser.parse_args() - lp = Launchpad.login_anonymously("check CLA", "production") - cla_members = lp.people["contributor-agreement-canonical"].participants - - if not lp_email_check(opts.email, lp, cla_members): - sys.exit(1) - -if __name__ == "__main__": - main() diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 8aaf7b1..da516f5 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "has-signed-canonical-cla", - "version": "1.2.0", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package-lock.json b/package-lock.json index 45e3c8b..80e018d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,15 @@ { "name": "has-signed-canonical-cla", - "version": "1.2.0", + "version": "2.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "has-signed-canonical-cla", - "version": "1.2.0", + "version": "2.0.0", "license": "ISC", "dependencies": { "@actions/core": "^1.2.6", - "@actions/exec": "^1.0.4", "@actions/github": "^6.0.0", "axios": "^1.6.8" } diff --git a/package.json b/package.json index 050b9bc..e5a3115 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "has-signed-canonical-cla", - "version": "1.2.0", + "version": "2.0.0", "description": "This GitHub Action verifies whether or not the authors of a pull request have signed the Canonical Contributor Licence Agreement (https://ubuntu.com/legal/contributors).", "main": "index.js", "scripts": { @@ -19,7 +19,6 @@ "homepage": "https://github.com/canonical/has-signed-canonical-cla#readme", "dependencies": { "@actions/core": "^1.2.6", - "@actions/exec": "^1.0.4", "@actions/github": "^6.0.0", "axios": "^1.6.8" }