cobertura-action icon indicating copy to clipboard operation
cobertura-action copied to clipboard

link missing files fails for windows action

Open wolframhaussig opened this issue 1 year ago • 3 comments

We integrated cobertura-action into a github action for .net on windows with the following config:

    - uses: 5monkeys/cobertura-action@master
      with:
        path: ./coverage/**/coverage.cobertura.xml
        skip_covered: false
        show_missing: true
        link_missing_lines: true
        link_missing_lines_source_dir: WinFormsThemes/WinFormsThemes
        minimum_coverage: 80

This works, but the links created by link_missing_lines are broken:

  • Created Url: https://github.com/Assorted-Development/winforms-themes/blob/7791d2d43f639f670c95f8756c77a5766025401b/WinFormsThemes/WinFormsThemes/Themes\FileTheme.cs?plain=1#L104-L106
  • Correct Url: https://github.com/Assorted-Development/winforms-themes/blob/7791d2d43f639f670c95f8756c77a5766025401b/WinFormsThemes/WinFormsThemes/Themes/FileTheme.cs?plain=1#L104-L106

The file seems to be reported as Themes\FileTheme.cs and is used directly in the created url instead of being translated into /.

An example can be found here

Is this a bug or do I need to configure something else?

wolframhaussig avatar Jul 28 '23 19:07 wolframhaussig

I'm seeing the same behavior, also on a Windows runner.

ryanhendersonabs avatar Aug 30 '23 22:08 ryanhendersonabs

@ryanhendersonabs If you are still looking for a Workaround, this is what we currently use:

    - name: Workaround for backslashes in path https://github.com/5monkeys/cobertura-action/issues/86 
       run: (Get-Content -path ./coverage/**/coverage.cobertura.xml -Raw) -replace '\\','/' | out-file -FilePath ./coverage/**/coverage.cobertura.xml

wolframhaussig avatar Aug 31 '23 12:08 wolframhaussig

@wolframhaussig awesome, thanks for sharing!

ryanhendersonabs avatar Aug 31 '23 13:08 ryanhendersonabs