Skip to content

sops fails to match path_regex on Windows because it encounters '\', not '/' #892

@cameronkerrnz

Description

@cameronkerrnz

Given a directory called my-local on Windows, the following will FAIL to match

creation_rules:
  - path_regex: .*/my-local/.*
    ...

But the following will:

creation_rules:
  # Sigh; must match the native idea of what filepath separator is used...
  - path_regex: .*[/\\]my-local[/\\].*
    ...

Windows 10 20H2
sops 3.7.1 (latest)

WSL-2 is not being used; sops is being run from a PowerShell session

Sops should ideally canonicalise the path separator, perhaps following established behaviour in the likes of .gitignore and .dockerignore files.

Documenting what the regex would begin to match on would be good too and any implicit anchoring that may be in effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions