13 src = fetchFromGitHub {
17 hash = "sha256-9DuADuEIoZNwkvdKyqus2zNfIK31Jc3+bPW3/z8fvlc=";
18 # populate values otherwise taken care of by goreleaser,
19 # unfortunately these require us to use git. By doing
20 # this in postFetch we can delete .git afterwards and
21 # maintain better reproducibility of the src.
25 git rev-parse HEAD > $out/COMMIT
26 # 0000-00-00T00:00:00Z
27 date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH
28 find "$out" -name .git -print0 | xargs -0 rm -rf
31 vendorHash = "sha256-apOVAlGjaYSrW4qtUdDNgqwWxnVlBLhrefWEUvN4lzE=";
33 nativeBuildInputs = [ installShellFiles ];
35 subPackages = [ "." ];
40 "-X sigs.k8s.io/release-utils/version.gitVersion=v${version}"
41 "-X sigs.k8s.io/release-utils/version.gitTreeState=clean"
44 # ldflags based on metadata from git and source
46 ldflags+=" -X sigs.k8s.io/release-utils/version.gitCommit=$(cat COMMIT)"
47 ldflags+=" -X sigs.k8s.io/release-utils/version.buildDate=$(cat SOURCE_DATE_EPOCH)"
51 # Feed in all but the e2e tests for testing
52 # This is because subPackages above limits what is built to just what we
53 # want but also limits the tests
55 go list ./... | grep -v e2e
57 # Ensure other e2e tests that have escaped the e2e dir dont run
62 "-skip TestCollectDockerfilePinning/Non-pinned_dockerfile|TestMixedPinning"
66 installShellCompletion --cmd scorecard \
67 --bash <($out/bin/scorecard completion bash) \
68 --fish <($out/bin/scorecard completion fish) \
69 --zsh <($out/bin/scorecard completion zsh)
72 doInstallCheck = true;
73 installCheckPhase = ''
74 runHook preInstallCheck
75 $out/bin/scorecard --help
76 $out/bin/scorecard version 2>&1 | grep "v${version}"
77 runHook postInstallCheck
80 passthru.tests.version = testers.testVersion {
82 command = "scorecard version";
83 version = "v${version}";
87 homepage = "https://github.com/ossf/scorecard";
88 changelog = "https://github.com/ossf/scorecard/releases/tag/v${version}";
89 description = "Security health metrics for Open Source";
90 mainProgram = "scorecard";
91 license = licenses.asl20;
92 maintainers = with maintainers; [ jk developer-guy ];