diff --git a/.github/workflows/action-ci.yml b/.github/workflows/action-ci.yml new file mode 100644 index 0000000..3b07aa4 --- /dev/null +++ b/.github/workflows/action-ci.yml @@ -0,0 +1,30 @@ +name: Action CI + +on: + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + smoke-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run action smoke test + id: inspectcode + uses: ./ + with: + help: "True" + format: "Text" + output: "inspectcode.txt" + + - name: Validate action outputs + shell: bash + run: | + test "${{ steps.inspectcode.outputs.report-file }}" = "inspectcode.txt" + test "${{ steps.inspectcode.outputs.report-format }}" = "Text" diff --git a/README.md b/README.md index d0a5784..5e1bf47 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ jobs: - name: Annotate # You may pin to the exact commit or the version. - uses: JetBrains/ReSharper-InspectCode@v0.11 + uses: JetBrains/ReSharper-InspectCode@v0.13 with: solution: ./YourSolution.sln @@ -41,7 +41,7 @@ jobs: Use [`with`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith) to define any action parameters: ```yaml with: - tool-version: 2025.2.3 + tool-version: 2026.1.0.1 ``` You can use GitHub Workflow editor to get a list of all supported inputs with descriptions. |Name |Description |Default | @@ -80,4 +80,20 @@ You can use GitHub Workflow editor to get a list of all supported inputs with de |`build` |Build solution before processing |True | |`target` |MsBuild target to execute before processing. |Build | |`solution` |Solution file | | -|`tool-version` |Tool Version |2025.2.3 | +|`tool-version` |Tool Version |2026.1.0.1 | +|`dotnet-version` |.NET SDK version used to install and run ReSharper command line tools |10.x | + +## Outputs + +|Name |Description | +|----------------|------------------------------------------------| +|`report-file` |Path to the generated inspection report file | +|`report-format` |Output format used for the inspection report | + +## Release process for `v0.13` + +This PR prepares the repository for the `v0.13` action release. + +After this PR is merged into `main`: +1. Create the `v0.13` tag on the merge commit. +2. Optionally create a GitHub Release for `v0.13`. diff --git a/action.yml b/action.yml index 512b290..c27b834 100644 --- a/action.yml +++ b/action.yml @@ -86,7 +86,17 @@ inputs: description: Solution file tool-version: description: Tool Version - default: "2025.3.3" + default: "2026.1.0.1" + dotnet-version: + description: .NET SDK version used to install and run ReSharper command line tools + default: "10.x" +outputs: + report-file: + description: Path to the generated inspection report file + value: ${{ steps.inspectcode.outputs.report-file }} + report-format: + description: Output format used for the inspection report + value: ${{ steps.inspectcode.outputs.report-format }} runs: using: composite steps: @@ -98,6 +108,7 @@ runs: shell: bash run: dotnet tool install JetBrains.ReSharper.GlobalTools --global --version ${{ inputs.tool-version }} - name: Inspect code with ReSharper + id: inspectcode shell: pwsh env: INPUT_settings: ${{ inputs.settings }} @@ -133,10 +144,29 @@ runs: INPUT_no-build: ${{ inputs.no-build }} INPUT_build: ${{ inputs.build }} INPUT_target: ${{ inputs.target }} + INPUT_solution: ${{ inputs.solution }} run: |- - $command = "jb inspectcode ${{ inputs.solution }}" - dir env:INPUT_* | Where-Object Value | %{ $command += " --$($_.Name -replace "^INPUT_")=$($_.Value)" } - Invoke-Expression $command + $arguments = @() + $positionalInputs = @("solution") + Get-ChildItem env:INPUT_* | Where-Object Value | ForEach-Object { + $optionName = $_.Name -replace "^INPUT_" + if ($optionName -notin $positionalInputs) { + $arguments += "--$optionName=$($_.Value)" + } + } + + if ($env:INPUT_solution) { + & jb inspectcode "$env:INPUT_solution" @arguments + } else { + & jb inspectcode @arguments + } + + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + "report-file=${{ inputs.output }}" >> $env:GITHUB_OUTPUT + "report-format=${{ inputs.format }}" >> $env:GITHUB_OUTPUT - name: Upload SARIF file if: inputs.format == 'Sarif' uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4