gestioCOF/workflows/pre-commit.nix
Tom Hubrecht d1fe524333
All checks were successful
Run pre-commit on all files / pre-commit (push) Successful in 20s
Run pre-commit on all files / pre-commit (pull_request) Successful in 20s
Check for missing migrations / migrations_check (pull_request) Successful in 1m35s
feat: Add git-hooks.nix
2025-01-12 11:21:08 +01:00

29 lines
599 B
Nix

# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{ ... }:
{
name = "Run pre-commit on all files";
on = [
"push"
"pull_request"
];
jobs.pre-commit = {
runs-on = "nix";
steps =
[ { uses = "actions/checkout@v3"; } ]
++ (builtins.map
(stage: {
name = "Check stage ${stage}";
run = "nix-shell -A pre-commit --run 'pre-commit run --all-files --hook-stage ${stage} --show-diff-on-failure'";
})
[
"pre-commit"
"pre-push"
]
);
};
}