summaryrefslogtreecommitdiff
path: root/modules/services/github-runner
diff options
context:
space:
mode:
authorMichael Hoang <Enzime@users.noreply.github.com>2024-11-07 12:00:23 +0000
committerGitHub <noreply@github.com>2024-11-07 12:00:23 +0000
commitfa7b46fa7716d0ff1abaa59ee2472ab25ad07188 (patch)
tree310e6ce8826e62b07304d089d883bdaa7f4f4137 /modules/services/github-runner
parent158198a6e3690facf15718b24571789c0756d43a (diff)
parent110d49af637c3da025b6b42a0caa81c1d63b2aed (diff)
Merge pull request #1143 from YorikSar/fix-github-runner-labels
github-runner: Fix labels for different nixpkgs versions
Diffstat (limited to 'modules/services/github-runner')
-rw-r--r--modules/services/github-runner/service.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/services/github-runner/service.nix b/modules/services/github-runner/service.nix
index c273f43..5d73633 100644
--- a/modules/services/github-runner/service.nix
+++ b/modules/services/github-runner/service.nix
@@ -94,6 +94,10 @@ in
script =
let
+ # https://github.com/NixOS/nixpkgs/pull/333744 introduced an inconsistency with different
+ # versions of nixpkgs. Use the old version of escapeShellArg to make sure that labels
+ # are always escaped to avoid https://www.shellcheck.net/wiki/SC2054
+ escapeShellArgAlways = string: "'${replaceStrings ["'"] ["'\\''"] (toString string)}'";
configure = pkgs.writeShellApplication {
name = "configure-github-runner-${name}";
text = /*bash*/''
@@ -104,7 +108,7 @@ in
--disableupdate
--work ${escapeShellArg workDir}
--url ${escapeShellArg cfg.url}
- --labels "${escapeShellArg (concatStringsSep "," cfg.extraLabels)}"
+ --labels ${escapeShellArgAlways (concatStringsSep "," cfg.extraLabels)}
${optionalString (cfg.name != null ) "--name ${escapeShellArg cfg.name}"}
${optionalString cfg.replace "--replace"}
${optionalString (cfg.runnerGroup != null) "--runnergroup ${escapeShellArg cfg.runnerGroup}"}