From 5860291a6e99ffef412c180c464ed87b5b866d89 Mon Sep 17 00:00:00 2001 From: Julian Wachholz Date: Thu, 23 Sep 2021 11:35:24 +0200 Subject: [PATCH] Add parameter to install plugins Fixes #22 --- action.yml | 4 ++++ dist/index.js | 3 ++- index.js | 3 ++- package.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 3174b56..de2d0a7 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,10 @@ inputs: description: "Path to use for flake8" default: "." required: false + plugins: + description: "Package names of flake8 plugins passed on to the `pip install` command." + default: "" + required: false config: description: "Specify a config file for flake8" required: false diff --git a/dist/index.js b/dist/index.js index 2ba46aa..eec8332 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14,7 +14,8 @@ const parseFlake8Output = __nccwpck_require__(586); const { GITHUB_TOKEN } = process.env; async function installFlake8() { - await exec.exec("pip install flake8"); + const plugins = core.getInput("plugins"); + await exec.exec(`pip install flake8 ${plugins}`); } async function runFlake8() { diff --git a/index.js b/index.js index 5e54f77..022cf84 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,8 @@ const parseFlake8Output = require("./parser"); const { GITHUB_TOKEN } = process.env; async function installFlake8() { - await exec.exec("pip install flake8"); + const plugins = core.getInput("plugins"); + await exec.exec(`pip install flake8 ${plugins}`); } async function runFlake8() { diff --git a/package.json b/package.json index 980a038..09a9e30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flake8-action", - "version": "2.0.1", + "version": "2.0.2", "description": "Flake8 GitHub Action", "main": "index.js", "scripts": {