diff options
author | Jean-François Roche <jfroche@affinitic.be> | 2022-07-25T08·15+0200 |
---|---|---|
committer | Jean-François Roche <jfroche@affinitic.be> | 2022-07-25T14·41+0000 |
commit | 282ad0015b85df11a686d4fe3f8da9975210206b (patch) | |
tree | 010e9c7daede9bb1e22c47eef7214fa373b62e55 | |
parent | 45c794f1b3febc2893afb7da359ddc2e981def34 (diff) |
fix(ops/buildkite): do not set branch if empty r/4322
To run an extra step for all branches, user don't set the `branches` attribute. This change avoid setting `branches` to null in such a case. Change-Id: Iabf2f3d0411b037ece5584f30b29c7e65420b63f Reviewed-on: https://cl.tvl.fyi/c/depot/+/5975 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to '')
-rw-r--r-- | nix/buildkite/default.nix | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/nix/buildkite/default.nix b/nix/buildkite/default.nix index 078b91094d11..5c46dcb33389 100644 --- a/nix/buildkite/default.nix +++ b/nix/buildkite/default.nix @@ -396,10 +396,6 @@ rec { (buildEnabled && !cfg.alwaysRun && !cfg.needsOutput) cfg.parent.key; - branches = - if cfg.branches != null - then lib.concatStringsSep " " cfg.branches else null; - command = pkgs.writeShellScript "${cfg.key}-script" '' set -ueo pipefail ${lib.optionalString cfg.needsOutput @@ -409,7 +405,10 @@ rec { echo '+++ Running extra step command' exec ${cfg.command} ''; - } // (lib.optionalAttrs (cfg.agents != null) { inherit (cfg) agents; }); + } // (lib.optionalAttrs (cfg.agents != null) { inherit (cfg) agents; }) + // (lib.optionalAttrs (cfg.branches != null) { + branches = lib.concatStringsSep " " cfg.branches; + }); in if (isString cfg.prompt) then |