Skip to content

Commit 2a480b2

Browse files
committed
make it harder to break input names by accident in cicero/cd action
1 parent 1e18f61 commit 2a480b2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

nix/cloud/actions.nix

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
ociRegistry,
99
...
1010
}: let
11-
pushInput = "push";
12-
pushBody = config.run.facts.${pushInput}.value.github_body;
11+
factNames = {
12+
ci = "ci";
13+
push = "push";
14+
};
15+
pushBody = config.run.facts.${factNames.push}.value.github_body;
1316
branch = lib.removePrefix "refs/heads/" pushBody.ref;
1417
in {
1518
io = ''
1619
let cfg = {
1720
#lib.io.github_push,
18-
#input: "${pushInput}"
21+
#input: "${factNames.push}"
1922
#repo: "input-output-hk/cicero"
2023
#default_branch: false
2124
inputs: _final_inputs
@@ -25,7 +28,7 @@
2528
inputs: {
2629
cfg.inputs
2730
28-
ci: match: {
31+
${factNames.ci}: match: {
2932
ok: true
3033
revision: cfg._revision
3134
}
@@ -52,7 +55,7 @@
5255
hcl =
5356
(
5457
let
55-
additionalInputs = {cicero = builtins.getFlake "github:input-output-hk/cicero/${pushBody.head_commit.id}";};
58+
additionalInputs = {cicero = builtins.getFlake "github:input-output-hk/cicero/${config.run.facts.${factNames.ci}.value.revision}";};
5659
additionalDesystemizedInputs = inputs.std.deSystemize inputs.cicero.defaultPackage.system additionalInputs;
5760
newInputs = inputs // additionalDesystemizedInputs;
5861
in

0 commit comments

Comments
 (0)