diff --git a/pkgs/by-name/ac/action-validator/package.nix b/pkgs/by-name/ac/action-validator/package.nix index e7556ce0043a..562f8520b7a5 100644 --- a/pkgs/by-name/ac/action-validator/package.nix +++ b/pkgs/by-name/ac/action-validator/package.nix @@ -3,24 +3,45 @@ rustPlatform, fetchFromGitHub, nix-update-script, + gitMinimal, + makeWrapper, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "action-validator"; - version = "0.8.0"; + version = "0.9.0"; src = fetchFromGitHub { owner = "mpalmer"; repo = "action-validator"; tag = "v${finalAttrs.version}"; - hash = "sha256-irBK27De9W5BSNIQynguOY8oPgA7K03dleE/0YvY75o="; + hash = "sha256-E0kqEzqw902Wg7QQNzOrtHQO9riSmAvDNcWIP3XmLSY="; fetchSubmodules = true; }; - cargoHash = "sha256-w6qC4gJ06TfoQl2WD8lgOxSxUWyG6Z8ma9mUvvYlkTU="; + cargoHash = "sha256-F8bJclpDpOdVET/dSIUYyP4DFcnhJDR2CV8poZtykko="; passthru.updateScript = nix-update-script { }; + nativeBuildInputs = [ makeWrapper ]; + + nativeCheckInputs = [ gitMinimal ]; + + # The tests require a functional git installation and leaveDotGit appears broken https://github.com/NixOS/nixpkgs/issues/8567 + preCheck = '' + git init -b main + git add --all # action-validator tests ignore unstaged files + ''; + + postCheck = '' + rm -rf .git + ''; + + postInstall = '' + wrapProgram "$out/bin/action-validator" \ + --prefix PATH : ${lib.makeBinPath [ gitMinimal ]} + ''; + meta = { description = "Tool to validate GitHub Action and Workflow YAML files"; homepage = "https://github.com/mpalmer/action-validator";