Skip to content

Commit

Permalink
Add debug mode option
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo López Dato committed Oct 6, 2022
1 parent f61a4c0 commit 3385658
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ jobs:
- name: Build
run: yarn build

- name: Run FOSSA scan and upload build data
- name: Run FOSSA scan in debug mode and upload build data
uses: ./
with:
api-key: ${{secrets.fossaApiKey}}
debug: true

- name: Upload debug bundle as a build artifact
uses: actions/upload-artifact@v3
with:
name: fossa.debug.json.gz
path: ./fossa.debug.json.gz

- name: Run FOSSA container scan and upload build data
uses: ./
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ inputs:
Override the detected FOSSA project branch. If running FOSSA analysis on a
Pull Request, as a start you can use the contexts `github.ref` or `github.ref_name`.
required: false
debug:
description: >-
Run all FOSSA commands in debug mode. Running `analyze` commands in debug
mode will generate a debug bundle that can be uploaded as a build artifact
after this action completes.
required: false

runs:
using: node16
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export const CONTAINER = getInput('container', getInputOptions());
export const RUN_TESTS = getBooleanInput('run-tests', {required: false});
export const ENDPOINT = getInput('endpoint', getInputOptions());
export const BRANCH = getInput('branch', getInputOptions());
export const DEBUG = getBooleanInput('debug', {required: false});
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
RUN_TESTS,
ENDPOINT,
BRANCH,
DEBUG,
} from './config';
import { fetchFossaCli } from './download-cli';

Expand All @@ -26,6 +27,7 @@ export async function analyze(): Promise<void> {
cmd,
...getEndpointArgs(),
...getBranchArgs(),
DEBUG ? '--debug' : null,
].filter(arg => arg);

// Setup listeners
Expand Down

0 comments on commit 3385658

Please sign in to comment.