Skip to content

Commit decddd3

Browse files
authored
fix: replace literal "\n" with newlines (#138)
1 parent 14dc1d8 commit decddd3

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
- Enables repositories to extend Danger checks without overwriting shared workflow comments
1212
- Sentry-CLI integration test action - Add `InvokeSentryResult::Events()` method to extract events from envelopes ([#137](https://github.com/getsentry/github-workflows/pull/137))
1313

14+
### Fixes
15+
16+
- Sentry-CLI integration test action - Replace literal "\n" with newlines ([#138](https://github.com/getsentry/github-workflows/pull/138))
17+
1418
## 3.1.0
1519

1620
### Features

sentry-cli/integration-test/action.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class InvokeSentryResult
3333
}
3434
elseif ($null -ne $envelope)
3535
{
36-
$envelope += $_ + "\n"
36+
$envelope += $_ + "`n"
3737
}
3838
}
3939
return $envelopes
@@ -47,7 +47,7 @@ class InvokeSentryResult
4747
$events = @()
4848
foreach ($envelope in $this.Envelopes())
4949
{
50-
$lines = @($envelope -split "\\n")
50+
$lines = @($envelope -split "`n")
5151
$header = $lines[0].Trim() | ConvertFrom-Json
5252
$eventId = $header | Select-Object -ExpandProperty event_id -ErrorAction SilentlyContinue
5353
if ($eventId -and $ids -notcontains $eventId)

sentry-cli/integration-test/tests/action.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ helloworld
7070
}
7171
Should -ActualValue $result.HasErrors() -BeFalse
7272
$result.Envelopes().Length | Should -Be 2
73-
$result.Envelopes()[0].Length | Should -Be 357
74-
$result.Envelopes()[1].Length | Should -Be 84
73+
$result.Envelopes()[0].Length | Should -Be 352
74+
$result.Envelopes()[1].Length | Should -Be 81
7575
}
7676

7777
It "collects gzip compressed envelopes" {
@@ -95,7 +95,7 @@ helloworld
9595

9696
Should -ActualValue $result.HasErrors() -BeFalse
9797
$result.Envelopes().Length | Should -Be 1
98-
$result.Envelopes()[0].Length | Should -Be 357
98+
$result.Envelopes()[0].Length | Should -Be 352
9999
}
100100

101101
It "discards duplicate events" {

0 commit comments

Comments
 (0)