Skip to content

Commit

Permalink
Merge pull request #71 from mitre/update-actions-to-v4
Browse files Browse the repository at this point in the history
Update README file to use actions v4
  • Loading branch information
Amndeep7 authored Jan 10, 2025
2 parents f35b717 + f64c5c1 commit fcfe678
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/example-usages-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Provide a few examples for using saf_action in GitHub workflows
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: windows-2022
steps:
- name: Checkout repo to have access to test data
uses: actions/checkout@v4
- name: Test convert data
uses: mitre/saf_action@main
with:
command_string: 'convert burpsuite2hdf -i ./test/sample_data/burpsuite_sample.min -o burpsuite_hdf.json'
- name: View summary of burpsuite results
uses: mitre/saf_action@main
with:
command_string: 'view summary -i burpsuite_hdf.json'
- name: Test validate threshold with -T
uses: mitre/saf_action@main
with:
command_string: 'validate threshold -i ./test/sample_data/red_hat_good.json -I "{\\"error.total\\": 0, \\"compliance.min\\": 50}"'
- name: Test validate threshold with -T with a space in the path
uses: mitre/saf_action@main
with:
command_string: 'validate threshold -i ./test/sample_data/red_hat_good\ with_space.json -I "{\\"error.total\\": 0, \\"compliance.min\\": 50}"'
- name: Artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: burpsuite
path: burpsuite_hdf.json
6 changes: 3 additions & 3 deletions .github/workflows/example-usages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Checkout repo to have access to test data
uses: actions/checkout@v4
- name: Test convert data
uses: mitre/saf_action@v1
uses: mitre/saf_action@main
with:
command_string: 'convert burpsuite2hdf -i ./test/sample_data/burpsuite_sample.min -o burpsuite_hdf.json'
- name: View summary of burpsuite results
Expand All @@ -22,11 +22,11 @@ jobs:
- name: Test validate threshold with -T
uses: mitre/saf_action@main
with:
command_string: 'validate threshold -i ./test/sample_data/red_hat_good.json -T "{\\"error.total\\": 0, \\"compliance.min\\": 50}"'
command_string: 'validate threshold -i ./test/sample_data/red_hat_good.json -I "{\\"error.total\\": 0, \\"compliance.min\\": 50}"'
- name: Test validate threshold with -T with a space in the path
uses: mitre/saf_action@main
with:
command_string: 'validate threshold -i ./test/sample_data/red_hat_good\ with_space.json -T "{\\"error.total\\": 0, \\"compliance.min\\": 50}"'
command_string: 'validate threshold -i ./test/sample_data/red_hat_good\ with_space.json -I "{\\"error.total\\": 0, \\"compliance.min\\": 50}"'
- name: Artifacts
uses: actions/upload-artifact@v4
if: success()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
command_string: 'convert asff2hdf -i asff_sample.json -o asff_sample_hdf.json'
- name: Artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
if: success()
with:
name: asff
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const saf_action = require('./run_command.js');
const path = require('node:path');

saf_action({safCLIPath: path.join(process.env.HOME, 'work/_actions/', process.env.GITHUB_ACTION_REPOSITORY, process.env.GITHUB_ACTION_REF, 'node_modules/@mitre/saf/lib/index.js')});
saf_action({safCLIPath: path.join(process.env.GITHUB_WORKSPACE, '../..', '_actions/', process.env.GITHUB_ACTION_REPOSITORY, process.env.GITHUB_ACTION_REF, 'node_modules/@mitre/saf/lib/index.js')});

0 comments on commit fcfe678

Please sign in to comment.