Skip to content

Commit

Permalink
Add config option - Fixes #55 (#59)
Browse files Browse the repository at this point in the history
Co-authored-by: Pieter Oliver <pieter.oliver@nourishcare.com>
  • Loading branch information
nficca and pieterocp authored Jan 22, 2025
1 parent ef29ba4 commit 52ed424
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ jobs:
uses: fossas/fossa-action@main # Use a specific version if locking is preferred
with:
api-key: ${{secrets.fossaApiKey}}
config: ./config/.fossa.yml # Use a config file not in the base working directory
- name: "Run FOSSA Test"
uses: fossas/fossa-action@main # Use a specific version if locking is preferred
with:
api-key: ${{secrets.fossaApiKey}}
run-tests: true
config: ./config/.fossa.yml
```

### Running Container Scanning
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export const BRANCH = getInput('branch', getInputOptions());
export const PROJECT = getInput('project', getInputOptions());
export const TEAM = getInput('team', {required: false});
export const POLICY = getInput('policy', {required: false});
export const CONFIG = getInput('config', {required: false});
export const DEBUG = getBooleanInput('debug', {required: false});
export const REPORT_FORMAT = getInput('generate-report', getInputOptions());
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
PROJECT,
TEAM,
POLICY,
CONFIG,
DEBUG,
REPORT_FORMAT,
} from './config';
Expand Down Expand Up @@ -39,6 +40,10 @@ export async function analyze(): Promise<void> {
'--policy',
POLICY,
];
const getConfigPath = (): string[] => !CONFIG ? [] : [
'--config',
CONFIG,
];

const getArgs = (cmd: string[]) => [
CONTAINER ? 'container' : null,
Expand All @@ -48,6 +53,7 @@ export async function analyze(): Promise<void> {
...getProjectArgs(),
...getTeamArgs(),
...getPolicyArgs(),
...getConfigPath(),
DEBUG ? '--debug' : null,
].filter(arg => arg);

Expand Down

0 comments on commit 52ed424

Please sign in to comment.