From f5855f3d185837076b03718a513e2052c8c17a27 Mon Sep 17 00:00:00 2001 From: Emily Rodriguez Date: Thu, 20 Apr 2023 10:44:02 -0500 Subject: [PATCH 1/2] update workflows and tests Signed-off-by: Emily Rodriguez --- .github/workflows/burpsuite2hdf.yml | 6 +++++- test/index.test.js | 9 ++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/burpsuite2hdf.yml b/.github/workflows/burpsuite2hdf.yml index f15882af4..4a30ebaff 100644 --- a/.github/workflows/burpsuite2hdf.yml +++ b/.github/workflows/burpsuite2hdf.yml @@ -1,4 +1,8 @@ -on: [push] +on: + push: + branches: [master] + pull_request: + branches: [master] jobs: heimdall_tools_conversion: runs-on: ubuntu-latest diff --git a/test/index.test.js b/test/index.test.js index bc729cc62..36174205d 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,18 +1,17 @@ const path = require('path'); -const saf_action = require('../index.js'); +const saf_action = require('../run_command.js'); describe('SAF Action tests', () => { it('should run SAF with a space topic separator in the command string', async () => { let inputFilePath = path.resolve('./test/sample_data/red_hat_good.json'); process.env['INPUT_COMMAND_STRING'] = `view summary -i ${inputFilePath}`; - require('../index.js'); - await saf_action(); + await saf_action({safCLIPath: "./node_modules/@mitre/saf/lib/index.js"}); delete process.env['INPUT_COMMAND_STRING']; }); - it('should run SAF with a semicolon topic separator in the command string', async () => { + it('should run SAF with a colon topic separator in the command string', async () => { let inputFilePath = path.resolve('./test/sample_data/red_hat_good.json'); process.env['INPUT_COMMAND_STRING'] = `view:summary -i ${inputFilePath}`; - await saf_action(); + await saf_action({safCLIPath: "./node_modules/@mitre/saf/lib/index.js"}); delete process.env['INPUT_COMMAND_STRING']; }); }); \ No newline at end of file From de7bb2c29bedba8f673f509f332cf7f012521544 Mon Sep 17 00:00:00 2001 From: Emily Rodriguez Date: Thu, 20 Apr 2023 10:54:29 -0500 Subject: [PATCH 2/2] check github context: Signed-off-by: Emily Rodriguez --- .github/workflows/burpsuite2hdf.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/burpsuite2hdf.yml b/.github/workflows/burpsuite2hdf.yml index 4a30ebaff..7717e6649 100644 --- a/.github/workflows/burpsuite2hdf.yml +++ b/.github/workflows/burpsuite2hdf.yml @@ -21,6 +21,8 @@ jobs: # with: # file: 'sample/burpsuite_sample.min' # converter: 'burpsuite_mapper' + - name: Get GitHub Action Path + run: echo "GITHUB_ACTION_PATH is - ${{ toJSON(github) }}" - name: Convert Burpsuite uses: em-c-rod/saf_action_test@master with: