Skip to content

Commit

Permalink
Mayhem URL defaults to app.mayhem.security if not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross-ForAllSecure authored May 3, 2024
2 parents 6031acb + 3831608 commit c31b188
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ jobs:
with:
mayhem-token: ${{ secrets.MAYHEM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
mayhem-url: https://app.mayhem.security
api-url: https://demo-api.mayhem4api.forallsecure.com/api/v3
api-spec: https://demo-api.mayhem4api.forallsecure.com/api/v3/openapi.json
api-url: https://demo-api.mayhem.security/api/v3
api-spec: https://demo-api.mayhem.security/api/v3/openapi.json
html-report: mapi.html
zap-api-scan: true
run-args: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ jobs:
continue-on-error: true
with:
mayhem-token: ${{ secrets.MAYHEM_TOKEN }}
mayhem-url: https://app.mayhem.security
api-url: https://demo-api.mayhem4api.forallsecure.com/api/v3
api-spec: https://demo-api.mayhem4api.forallsecure.com/api/v3/openapi.json
api-url: https://demo-api.mayhem.security/api/v3
api-spec: https://demo-api.mayhem.security/api/v3/openapi.json
html-report: mapi.html
run-args: |
--warnaserror
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ The action accepts the follow inputs:
| | `html-report` | string | Path to the generated SARIF report |
| | `sarif-report` | string | Path to the generated HTML report |
| | `run-args` | string | Additional arguments to provide to the `mapi run` command. Argument values should be separated on new lines. <br><br>e.g.<br> <pre> run-args: \|<br> # Basic Auth<br> --basic-auth<br> login:password</pre><br>⚠️ Avoid wrapping values in quotes, as these will be escaped and included in the value passed to `mapi`.<br><br>⛔️ `"login:password"` <br>✅ `login:password` |
| | `mayhem-url` | string | Path to your Mayhem API instance. If you're using something other than the default of https://app.mayhem.security |
| | `mayhem-url` | string | Mayhem API override | https://app.mayhem.security


### Continuing on error

Expand Down
5 changes: 2 additions & 3 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ const mapi_api_run = (additional_env: {[key: string]: string}) => {
process.env['INPUT_GITHUB-TOKEN'] = process.env.GITHUB_TOKEN
process.env['INPUT_DURATION'] = '10'
process.env['INPUT_ZAP-API-SCAN'] = 'true'
process.env['INPUT_API-URL'] =
'https://demo-api.mayhem4api.forallsecure.com/api/v3'
process.env['INPUT_API-URL'] = 'https://demo-api.mayhem.security/api/v3'
process.env['INPUT_API-SPEC'] =
'https://demo-api.mayhem4api.forallsecure.com/api/v3/openapi.json'
'https://demo-api.mayhem.security/api/v3/openapi.json'
const np = process.execPath
const ip = path.join(__dirname, '..', 'lib', 'main.js')
const options: ExecFileSyncOptions = {
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ inputs:
run-args:
description: A list of additional arguments (separated by '\n') to include in the call to 'mapi run'. Run 'mapi run --help' for a complete list of arguments.
mayhem-url:
description: Mayhem API override
description: "Mayhem API override. | https://app.mayhem.security"
runs:
using: 'node20'
main: 'dist/index.js'
Expand Down
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ async function run(): Promise<void> {

// Load inputs
const mayhemToken: string = core.getInput('mayhem-token')
const mayhemUrl: string = core.getInput('mayhem-url')
// Set default if not provided
const mayhemUrl: string =
core.getInput('mayhem-url') || 'https://app.mayhem.security'
const cli = await mapiCLI(mayhemUrl)
const githubToken: string = core.getInput('github-token', {required: true})
const apiUrl: string = core.getInput('api-url', {required: true})
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2440,9 +2440,9 @@ eslint-plugin-import@^2.25.2:
tsconfig-paths "^3.15.0"

eslint-plugin-jest@^28.3.0:
version "28.3.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.3.0.tgz#d52dea5e4f191fde061cbf1cea44c8a0a23e62ec"
integrity sha512-5LjCSSno8E+IUCOX4hJiIb/upPIgpkaDEcaN/40gOcw26t/5UTLHFc4JdxKjOOvGTh0XdCu+fNr0fpOVNvcxMA==
version "28.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.4.0.tgz#213be88f799a35ca9d63ce1a30081bb32b8da765"
integrity sha512-ORVHiFPC8RQxHLyQJ37MxNilK9k+cPzjHz65T8gAbpYZunGutXvKqwfM3WXBCvFDF1QBeYJJu9LB/i5cuXBs+g==
dependencies:
"@typescript-eslint/utils" "^6.0.0"

Expand Down

0 comments on commit c31b188

Please sign in to comment.