1 # `pkgs/by-name` check CI scripts
3 This directory contains scripts and files used and related to the CI running the `pkgs/by-name` checks in Nixpkgs.
4 See also the [CI GitHub Action](../../../.github/workflows/check-by-name.yml).
6 ## `./run-local.sh BASE_BRANCH [REPOSITORY]`
8 Runs the `pkgs/by-name` check on the HEAD commit, closely matching what CI does.
10 Note that this can't do exactly the same as CI,
11 because CI needs to rely on GitHub's server-side Git history to compute the mergeability of PRs before the check can be started.
12 In turn when running locally, we don't want to have to push commits to test them,
13 and we can also rely on the local Git history to do the mergeability check.
16 - `BASE_BRANCH`: The base branch to use, e.g. master or release-24.05
17 - `REPOSITORY`: The repository to fetch the base branch from, defaults to https://github.com/NixOS/nixpkgs.git
19 ## `./update-pinned-tool.sh`
21 Updates the pinned [nixpkgs-check-by-name tool](https://github.com/NixOS/nixpkgs-check-by-name) in [`./pinned-version.txt`](./pinned-version.txt) to the latest [release](https://github.com/NixOS/nixpkgs-check-by-name/releases).
22 Each release contains a pre-built x86_64-linux version of the tool which is used by CI.
24 This script currently needs to be called manually when the CI tooling needs to be updated.
26 Why not just build the tooling right from the PRs Nixpkgs version?
27 - Because it allows CI to check all PRs, even if they would break the CI tooling.
28 - Because it makes the CI check very fast, since no Nix builds need to be done, even for mass rebuilds.
29 - Because it improves security, since we don't have to build potentially untrusted code from PRs.
30 The tool only needs a very minimal Nix evaluation at runtime, which can work with [readonly-mode](https://nixos.org/manual/nix/stable/command-ref/opt-common.html#opt-readonly-mode) and [restrict-eval](https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-restrict-eval).