From ccf65eaef8aaa307b0a1bd5b64778e8a51d07453 Mon Sep 17 00:00:00 2001 From: Stijn Opheide Date: Thu, 13 Jan 2022 14:42:41 +0100 Subject: [PATCH] add optional option to specify working directory --- README.md | 17 ++++++++++++++++- action.yml | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b90423b..d6ddf8c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ jobs: java-version: '8' - name: NVD Scan - uses: vouch-opensource/clojure-nvd-scan@v0.1 + uses: vouch-opensource/clojure-nvd-scan@v0.2 with: config-filename: '.nvd/config.json' aliases: 'dev:main' @@ -37,3 +37,18 @@ jobs: ### Configuration Refer to [nvd-clojure configuration options](https://github.com/rm-hull/nvd-clojure#configuration-options). This github action uses the json configuration format. + +### Working directory + +In case you want to run the NVD scan in a different directory than the default GITHUB_WORKSPACE, you can specify the +`working-directory` option + +```yml + - name: NVD Scan + uses: vouch-opensource/clojure-nvd-scan@v0.2 + with: + working-directory: './cljs' + config-filename: '../.nvd/config.json' +``` + +Note that in case you also want to specify a config file, you have to provide a relative path from the working-directory. diff --git a/action.yml b/action.yml index e63f576..e826132 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,9 @@ name: 'Clojure NVD Scan' description: 'Scans a Clojure deps.edn project for vulnerabilities' inputs: + working-directory: + description: 'Directory in which to execute the NVD scan' + required: false config-filename: description: 'Config file path' required: false @@ -51,4 +54,5 @@ runs: - name: NVD Scan run: clojure -Sdeps '{:deps {nvd-clojure/nvd-clojure {:mvn/version "${{ inputs.nvd-clojure-version }}"}}}' -M -m nvd.task.check ${{ inputs.config-filename }} "$(clojure -A:${{ inputs.aliases }} -Spath)" + working-directory: ${{ inputs.working-directory }} shell: bash