change only the files template #619
Answered
by
mrexox
hituzi-no-sippo
asked this question in
Q&A
-
Thanks for creating this great tool. I would like to change only the files template such as I write all the same scripts except for the files templates, as in the following YAML configuration: ---
pre-commit:
commands:
hoo: &staged
run: echo {staged_files}
pre-push:
commands:
hoo:
run: echo {push_files}
pre-merge-commit:
commands:
hoo: *staged
lint:
commands:
hoo:
run: echo {all_files} The files templates, which I would like to use is as follows:
Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
mrexox
Feb 1, 2024
Replies: 1 comment 1 reply
-
Hey! I think in this case you can use custom lint:
files: git ls-files --cached # all files
commands:
hoo: &hoo
run: echo {files}
pre-merge-commit:
files: git diff --name-only --cached --diff-filter=ACMR
commands:
hoo: *hoo
pre-commit:
files: git diff --name-only --cached --diff-filter=ACMR
commands:
hoo: *hoo
pre-push:
files: git diff --name-only HEAD @{push}
commands:
hoo: *hoo Please, write back if it helps! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hituzi-no-sippo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! I think in this case you can use custom
files
for each hook like this:Please, write back if it helps!