Skip to content

Commit

Permalink
Upload analysis results sarif file
Browse files Browse the repository at this point in the history
  • Loading branch information
mavasani committed Apr 20, 2021
1 parent a697aa4 commit 3cd3714
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/on-push-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ jobs:
project: .\sample\ClassLibrary1.sln
build-breaking: false
all-categories: all

# Upload the analysis results file
- name: Upload analysis results
uses: actions/upload-artifact@v2
with:
name: analysis_results.sarif
path: ${{ steps.code-analysis.outputs.sarifFile }}
7 changes: 7 additions & 0 deletions .github/workflows/sample-workflow-ubuntu-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ jobs:
id: code-analysis
with:
build-breaking: false

# Upload the analysis results file
- name: Upload analysis results
uses: actions/upload-artifact@v2
with:
name: analysis_results.sarif
path: ${{ steps.code-analysis.outputs.sarifFile }}
7 changes: 7 additions & 0 deletions .github/workflows/sample-workflow-windows-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ jobs:
id: code-analysis
with:
build-breaking: false

# Upload the analysis results file
- name: Upload analysis results
uses: actions/upload-artifact@v2
with:
name: analysis_results.sarif
path: ${{ steps.code-analysis.outputs.sarifFile }}
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ inputs:
default: ''
outputs:
sarifFile:
description: A file path to a SARIF file with analysis results.
description: A file path to a '.sarif' file with analysis results.
runs:
using: 'node12'
main: 'lib/action.js'
4 changes: 2 additions & 2 deletions lib/msca-toolkit/msca-toolkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ class MscaAction {
args.push('--logger-level');
args.push('trace');
}
let sarifFile = path.join(process.env.GITHUB_WORKSPACE, '.gdn', 'msca.sarif');
let sarifFile = path.join(process.env.GITHUB_WORKSPACE, '.gdn', 'analysis_results.sarif');
core.debug(`sarifFile = ${sarifFile}`);
// Write it as a GitHub Action variable for follow up tasks to consume
core.exportVariable('MSCA_SARIF_FILE', sarifFile);
core.exportVariable('ANALYSIS_RESULTS_SARIF_FILE', sarifFile);
core.setOutput('sarifFile', sarifFile);
args.push('--export-breaking-results-to-file');
args.push(`${sarifFile}`);
Expand Down
4 changes: 2 additions & 2 deletions src/msca-toolkit/msca-toolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export class MscaAction {
args.push('trace');
}

let sarifFile : string = path.join(process.env.GITHUB_WORKSPACE, '.gdn', 'msca.sarif');
let sarifFile : string = path.join(process.env.GITHUB_WORKSPACE, '.gdn', 'analysis_results.sarif');
core.debug(`sarifFile = ${sarifFile}`);

// Write it as a GitHub Action variable for follow up tasks to consume
core.exportVariable('MSCA_SARIF_FILE', sarifFile);
core.exportVariable('ANALYSIS_RESULTS_SARIF_FILE', sarifFile);
core.setOutput('sarifFile', sarifFile);

args.push('--export-breaking-results-to-file');
Expand Down

0 comments on commit 3cd3714

Please sign in to comment.