Merge pull request #1519 from basecamp/escape-audit-line

Escape the audit line
This commit is contained in:
Donal McBreen
2025-04-22 09:00:49 +01:00
committed by GitHub
2 changed files with 15 additions and 13 deletions

View File

@@ -20,8 +20,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal", "&&",
:echo,
"[#{@recorded_at}] [#{@performer}]",
"app removed container",
"\"[#{@recorded_at}] [#{@performer}] app removed container\"",
">>", ".kamal/app-audit.log"
], @auditor.record("app removed container")
end
@@ -31,8 +30,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal", "&&",
:echo,
"[#{@recorded_at}] [#{@performer}] [staging]",
"app removed container",
"\"[#{@recorded_at}] [#{@performer}] [staging] app removed container\"",
">>", ".kamal/app-staging-audit.log"
], auditor.record("app removed container")
end
@@ -43,8 +41,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal", "&&",
:echo,
"[#{@recorded_at}] [#{@performer}] [web]",
"app removed container",
"\"[#{@recorded_at}] [#{@performer}] [web] app removed container\"",
">>", ".kamal/app-audit.log"
], auditor.record("app removed container")
end
@@ -54,8 +51,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal", "&&",
:echo,
"[#{@recorded_at}] [#{@performer}] [value]",
"app removed container",
"\"[#{@recorded_at}] [#{@performer}] [value] app removed container\"",
">>", ".kamal/app-audit.log"
], @auditor.record("app removed container", detail: "value")
end