nix, .github: gate workflows on zizmor

Flake check, nix-checks job and prek hook; offline, starting at zero findings.
This commit is contained in:
Kristoffer Dalby committed 2026-11-20 19:47:15 +01:00
1 parent e52ba94b0c
commit 7d07d53837
5 files changed
+50 -1

No files matched your search

+26
View File
@@ -149,6 +149,7 @@
gh
gh-actions-lock
zizmor
ksh
ko
yq-go
@@ -392,6 +393,30 @@
grep -F '"file:\''${CREDENTIALS_DIRECTORY}/oidc_client_secret"' ${doc.optionsCommonMark}
touch $out
'';
# Offline, so a new advisory for some action cannot fail unrelated
# pull requests. Not named zizmor: that would shadow pkgs.zizmor in
# devDeps' `with pkgs`.
zizmor-check =
pkgs.runCommand "headscale-zizmor"
{
nativeBuildInputs = [ pkgs.zizmor ];
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./.github
./.pre-commit-config.yaml
];
};
}
''
# zizmor reads actions.lock only from a directory with a .git.
cp -r "$src" tree
chmod -R u+w tree
mkdir tree/.git
zizmor --offline --no-progress --cache-dir "$TMPDIR" tree
touch $out
'';
in
{
# `nix develop`
@@ -449,6 +474,7 @@
headscale-checks = pkgs.testers.runNixOSTest (import ./nix/tests/checks.nix self);
nixos-module = import ./nix/tests/module.nix self pkgs;
inherit nixos-options;
zizmor = zizmor-check;
}
);
}