Skip to content

[Feature] add option to return forward slashes on windows instead of backslash #2044

@rantoniuk

Description

@rantoniuk

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

It seems like a regression for #340. I have this:

jobs:
  tests:
      runs-on: windows-latest
      name: tests

...

        - name: Get changed files
          id: changed-files
          uses: tj-actions/changed-files@v44
          with:
            safe_output: false
            files_ignore: |
              segmentation/**
            files: |
              **/*.py
              **/*.pyi

        - name: List all changed files
          shell: bash
          env:
            ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
          run: |
            for file in ${ALL_CHANGED_FILES}; do
              echo "$file was changed"
            done

...

        - name: "Code Lint - Black"
          uses: psf/black@stable
          if: steps.changed-files.outputs.all_changed_files
          env:
            ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
          with:
            src: ${{ env.ALL_CHANGED_FILES }}

...

When ran on a windows runner, I see backslashes for directories instead of forward slashes in List all changed files output. Then the black job fails because it misinterprets the backslashes as escapes on Windows.

To Reproduce

As above.

What OS are you seeing the problem on?

windows-latest or windows-2022

Expected behavior?

Forward slashes should be used always in the output - see e.g.
https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#include

Relevant log output

Too complex workflow to push all the debug logs.

Has all relevant logs been included?

  • I've included all relevant logs

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions