Skip to content

Commit 499b1b9

Browse files
committed
cleanup
1 parent b26c5d4 commit 499b1b9

8 files changed

Lines changed: 45 additions & 14 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
test:
99
runs-on: ubuntu-latest
10-
10+
1111
steps:
1212
- name: Checkout Sources
1313
uses: actions/checkout@v2

.github/workflows/build_executables.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
type: [linux-x64, mac-x64, windows-x64]
1111

1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
1515
- name: Checkout Sources
1616
uses: actions/checkout@v2

.github/workflows/manual.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ on:
66
jobs:
77
test:
88
runs-on: ubuntu-latest
9-
9+
1010
steps:
11-
11+
1212
- name: Checkout Sources
1313
uses: actions/checkout@v2
14-
14+
1515
- name: Invoke Action
1616
uses: ./
1717
with:
1818
sarifReportDir: ./samples/sarif/peter-murray/advanced-security-java
1919
outputDir: .
20-
20+
2121
- name: Upload Artifacts
2222
uses: actions/upload-artifact@v2
2323
with:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Manual Test Custom Template
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: ./
13+
with:
14+
token: ${{ secrets.SECURITY_TOKEN }}
15+
sarifReportDir: ./samples/sarif/peter-murray/advanced-security-java
16+
outputDir: .
17+
templateFile: template.html
18+
- uses: actions/upload-artifact@v2
19+
with:
20+
name: reports
21+
path: ./*.pdf

.github/workflows/manual_test_repo.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ on:
66
jobs:
77
test:
88
runs-on: ubuntu-latest
9-
9+
1010
steps:
11-
11+
1212
- name: Checkout Sources
1313
uses: actions/checkout@v2
14-
14+
1515
- name: Invoke Action
1616
uses: ./
1717
with:
1818
sarifReportDir: ./samples/sarif/java/detailed
1919
outputDir: .
2020
repository: octodemo/ghas-reporting
21-
21+
2222
- name: Upload Artifacts
2323
uses: actions/upload-artifact@v2
2424
with:

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@ inputs:
77
description: The GitHub token used to create an authenticated client
88
default: ${{ github.token }}
99
required: true
10+
1011
sarifReportDir:
1112
description: The CodeQL output directory for SARIF report(s).
1213
required: true
1314
default: "../results"
15+
1416
outputDir:
1517
description: The output directory for the generated report(s).
1618
required: true
1719
default: ${{ github.workspace }}
20+
1821
repository:
1922
description: Repository name with owner. For example, peter-murray/github-security-report
2023
required: true
2124
default: ${{ github.repository }}
25+
2226
templateFile:
2327
description: File to use as PDF template. For example, summary.pdf
2428
required: false

src/executable.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ async function execute(reportGenerateConfig: ReportGeneratorConfig) {
3636
console.log(`Summary Report generated: ${file}`);
3737

3838
} catch (err) {
39-
console.log(err.stack);
40-
console.error(err.message);
41-
console.error();
39+
if (err instanceof Error) {
40+
console.error(err.message, err.stack);
41+
} else {
42+
console.error(JSON.stringify(err));
43+
}
4244
program.help({error: true});
4345
}
4446
}

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ async function run(): Promise<void> {
2424
const file = await generator.run();
2525
console.log(file);
2626
} catch (err) {
27-
core.setFailed(err.message);
27+
if (err instanceof Error) {
28+
core.setFailed(err.message);
29+
} else {
30+
core.setFailed(JSON.stringify(err));
31+
}
2832
}
2933
}
3034

0 commit comments

Comments
 (0)