mirror of
https://github.com/DeterminateSystems/flake-checker.git
synced 2024-09-17 17:37:14 +03:00
Get allowed branches programmatically
This commit is contained in:
parent
729f7d10dd
commit
6398fd8684
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -14,4 +14,5 @@ jobs:
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@v2
|
||||
- run: |
|
||||
nix develop -c get-refs
|
||||
nix develop -c cargo run -- ./flake.bad.lock
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ result
|
||||
|
||||
# Generated
|
||||
summary.md
|
||||
src/policy.json
|
||||
|
10
flake.nix
10
flake.nix
@ -10,6 +10,13 @@
|
||||
inputs.rust-overlay.overlays.default
|
||||
(final: prev: {
|
||||
rustToolchain = prev.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
|
||||
get-refs = prev.writeScriptBin "get-refs" ''
|
||||
${prev.curl}/bin/curl --fail --silent \
|
||||
'https://monitoring.nixos.org/prometheus/api/v1/query?query=channel_revision' \
|
||||
| ${prev.jq}/bin/jq -r '{ "allowed_branches": [(.data.result[] | select(.metric.current == "1") | .metric.channel)] | sort, "max_days": 30 }' \
|
||||
> src/policy.json
|
||||
'';
|
||||
})
|
||||
];
|
||||
systems = [ "aarch64-linux" "aarch64-darwin" "x86_64-linux" "x86_64-darwin" ];
|
||||
@ -26,6 +33,9 @@
|
||||
cargo-edit
|
||||
cargo-watch
|
||||
rust-analyzer
|
||||
|
||||
# Helpers
|
||||
get-refs
|
||||
];
|
||||
};
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"allowed_refs": [
|
||||
"allowed_branches": [
|
||||
"nixos-22.11",
|
||||
"nixos-22.11-small",
|
||||
"nixos-unstable",
|
||||
|
Loading…
Reference in New Issue
Block a user