We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using SOPS with a .gitattributes and .sops.yaml file.
.gitattributes
.sops.yaml
See content of files below:
# .gitattributes secret.json filter=sops-json secret.yaml filter=sops-yaml diff=sops-yaml secret.yml filter=sops-yaml diff=sops-yaml
# .sops.yaml creation_rules: - age: >- age1<REDACTED>, age1<REDACTED> encrypted_regex: ^(password|metadata|privateKey)$ path_regex: '(secret.json|test.yaml)'
And the config part from .git/config file:
.git/config
[filter "sops-json"] clean = sops --input-type json --output-type json -e /dev/stdin smudge = SOPS_AGE_KEY_FILE=$(pwd)/secrets/age-key.txt sops --input-type json --output-type json -d /dev/stdin required = true
I can run the commands for encrypt/decrypt as expected:
sops -e -i secret.json SOPS_AGE_KEY_FILE=$(pwd)/secrets/age-key.txt sops -d -i secret.json
But when I'm using git to try to commit the files I always get the following error message:
git
> git status -z -uall error loading config: no matching creation rules found error: external filter 'sops --input-type json --output-type json -e /dev/stdin' failed 1 error: external filter 'sops --input-type json --output-type json -e /dev/stdin' failed fatal: secret.json: clean filter 'sops-json' failed
Maybe someone has an idea what's happening here.
EDIT: When I remove path_regex: '(secret.json|test.yaml)' from the .sops.yaml file it also works with git.
path_regex: '(secret.json|test.yaml)'
The text was updated successfully, but these errors were encountered:
It's an old question, but I just solved it by changing /dev/stdin in the filter.<name>.clean and filter.<name>.smudge to use %f
/dev/stdin
filter.<name>.clean
filter.<name>.smudge
%f
[filter "sops-json"] clean = sops --input-type json --output-type json -e %f smudge = SOPS_AGE_KEY_FILE=$(pwd)/secrets/age-key.txt sops --input-type json --output-type json -d %f required = true
Sorry, something went wrong.
No branches or pull requests
I'm using SOPS with a
.gitattributes
and.sops.yaml
file.See content of files below:
And the config part from
.git/config
file:I can run the commands for encrypt/decrypt as expected:
sops -e -i secret.json SOPS_AGE_KEY_FILE=$(pwd)/secrets/age-key.txt sops -d -i secret.json
But when I'm using
git
to try to commit the files I always get the following error message:Maybe someone has an idea what's happening here.
EDIT: When I remove
path_regex: '(secret.json|test.yaml)'
from the.sops.yaml
file it also works with git.The text was updated successfully, but these errors were encountered: