mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-24 22:26:29 +09:00
nix, .github: gate workflows on zizmor
Flake check, nix-checks job and prek hook; offline, starting at zero findings.
This commit is contained in:
1 parent
e52ba94b0c
commit
7d07d53837
5 files changed
+50
-1
No files matched your search
@@ -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;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user