Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/action-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ jobs:
uses: ./
with:
help: "True"
format: "Text"
output: "inspectcode.txt"
format: "Sarif"
output: "inspectcode.sarif.json"
upload-sarif: "false"

- name: Validate action outputs
shell: bash
run: |
test "${{ steps.inspectcode.outputs.report-file }}" = "inspectcode.txt"
test "${{ steps.inspectcode.outputs.report-format }}" = "Text"
test "${{ steps.inspectcode.outputs.report-file }}" = "inspectcode.sarif.json"
test "${{ steps.inspectcode.outputs.report-format }}" = "Sarif"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ jobs:
uses: JetBrains/ReSharper-InspectCode@v0.13
with:
solution: ./YourSolution.sln
upload-sarif: false

permissions:
security-events: write
```

When `upload-sarif: false` is used, `security-events: write` permission is not required.

## Configuration

Use [`with`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith) to define any action parameters:
Expand All @@ -49,6 +52,7 @@ You can use GitHub Workflow editor to get a list of all supported inputs with de
|`settings` |Path to the file to use custom settings from (default: Use R#'s solution shared settings if exists) | |
|`output` |Write inspections report to specified file |results.sarif.json|
|`format` |Write inspections report in specified format [Xml, Html, Text, Sarif] |Sarif |
|`upload-sarif` |Upload SARIF report to GitHub code scanning (`true`/`false`) |true |
|`jobs` |Run up to N jobs in parallel. 0 means as many as possible |0 |
|`absolute-paths` |Use absolute paths in inspections report |False |
|`no-swea` |Force disable solution-wide analysis |False |
Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
format:
description: Write inspections report in specified format [Xml, Html, Text, Sarif]
default: "Sarif"
upload-sarif:
description: Upload SARIF report to GitHub code scanning
default: "true"
jobs:
description: Run up to N jobs in parallel. 0 means as many as possible
default: "0"
Expand Down Expand Up @@ -168,7 +171,7 @@ runs:
"report-file=${{ inputs.output }}" >> $env:GITHUB_OUTPUT
"report-format=${{ inputs.format }}" >> $env:GITHUB_OUTPUT
- name: Upload SARIF file
if: inputs.format == 'Sarif'
if: inputs.format == 'Sarif' && inputs.upload-sarif == 'true'
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
with:
sarif_file: ${{ inputs.output }}
Expand Down