cargo icon indicating copy to clipboard operation
cargo copied to clipboard

--color=always removes the benefits of this action

Open EdJoPaTo opened this issue 4 years ago • 0 comments

Do the checklist before filing an issue:

  • [x] Is this related to the actions-rs Actions? If you think it's a problem related to Github Actions in general, use GitHub Community forum instead: https://github.community
  • [x] You've read the Contributing section about bugs reporting: https://github.com/actions-rs/.github/blob/master/CONTRIBUTING.md#reporting-bugs
  • [ ] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.

Description

This action runs cargo with arguments. When cargo finds problems they are annotated in a way GitHub can display them at the exact file / line.

When --color=always is added this doesn't work anymore.

You can reproduce this by creating some issue which cargo highlights. This works properly. When --color=always is added the output reduces to "[…] failed with exit code 101".

Workflow code

      - name: Check clippy
        uses: actions-rs/cargo@v1
        with:
          command: clippy
-          args: --verbose --locked --all-targets ${{ matrix.features }} -- ${{ matrix.clippyargs }}
+          args: --verbose --locked --all-targets ${{ matrix.features }} --color=always -- ${{ matrix.clippyargs }}

Action output

works

https://github.com/EdJoPaTo/rust-binary-metafile-template/actions/runs/1399909575

works.zip

works

doesn't work

https://github.com/EdJoPaTo/rust-binary-metafile-template/actions/runs/1399969307

doesnt-work.zip

doesntwork

Expected behavior

Described above

Additional context

--color=always is probably not working because of additional escape codes in the output.

Personal opinion: I do not think its interesting to support color output. I think outputting a warning when --color is specified is helpful to prevent people from running into this issue.

EdJoPaTo avatar Oct 29 '21 17:10 EdJoPaTo