fix(workflows): Copy rootSrc to check gloPatterns correctly

This commit is contained in:
Tom Hubrecht 2024-11-11 17:18:38 +01:00
parent 15833ec9d7
commit d09ac44347
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
2 changed files with 17 additions and 3 deletions

View file

@ -6,6 +6,8 @@
let
inherit (pkgs) lib mkShell;
inherit (pkgs.lib.fileset) gitTracked toSource;
git-checks = (import sources.git-hooks).run {
src = ./.;
@ -39,14 +41,18 @@ in
};
install =
config:
{ src, ... }@config:
let
project = lib.evalModules {
modules = [
./modules
{
config = config // {
config = (removeAttrs config [ "src" ]) // {
_module.args.pkgs = pkgs;
rootSrc = toSource {
root = src;
fileset = gitTracked src;
};
};
}
];

View file

@ -21,6 +21,7 @@ let
attrsOf
bool
enum
path
str
;
@ -49,7 +50,7 @@ let
json2yaml "$valuePath" "$out"
# Check that the workflow is valid
action-validator "$out"
cd "${cfg.rootSrc}" && action-validator "$out"
''
) { };
@ -104,6 +105,13 @@ in
Whether to remove unknown workflow files.
'';
};
rootSrc = mkOption {
type = path;
description = ''
The source of the project.
'';
};
};
config = {