@@ -30,21 +30,21 @@ jobs:
3030 run : dotnet build ${{ env.solutionPath }} --configuration Release --no-restore
3131 - name : Execute unit tests
3232 run : dotnet test ${{ env.solutionPath }} --configuration Release --settings ${{ env.solutionFolder }}/Console.Tests/CodeCoverage.runsettings --no-build --logger trx --no-restore --results-directory "TestResults" --collect:"XPlat code coverage"
33- - name : Publish Test Report
34- uses : phoenix-actions/test-reporting@v8
35- id : test-report # Set ID reference for step
36- if : ${{ (success() || failure()) && (github.event_name == 'pull_request') }} # run this step even if previous step failed
37- with :
38- name : unit tests # Name of the check run which will be created
39- path : TestResults/*.trx # Path to test results
40- reporter : dotnet-trx # Format of test results
33+ - name : Get first subfolder name
34+ id : get_subfolder
35+ shell : pwsh
36+ run : |
37+ $folderPath = 'your/folder/path'
38+ $firstSubfolder = Get-ChildItem -Path $folderPath -Directory | Select-Object -First 1
39+ $name = if ($firstSubfolder) { $firstSubfolder.Name } else { "" }
40+ echo "subfolder_name=$name" >> $env:GITHUB_OUTPUT
4141 - name : Create Test Coverage Badge
42424343 id : create_coverage_badge
4444 with :
4545 label : Unit Test Coverage
4646 color : brightgreen
47- path : TestResults/* /coverage.opencover.xml
47+ path : TestResults/${{ steps.get_subfolder.outputs.subfolder_name }} /coverage.opencover.xml
4848 gist-filename : code-coverage.json
4949 gist-id : ${{ env.GIST_REPO_ID }}
5050 gist-auth-token : ${{ secrets.GIST_AUTH_TOKEN }}
0 commit comments