File tree Expand file tree Collapse file tree 5 files changed +124
-4
lines changed
testdata/changelog/plain-text-intro Expand file tree Collapse file tree 5 files changed +124
-4
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ To update your existing Danger workflows:
57
57
58
58
# ## Fixes
59
59
60
+ - Updater - Fix bullet-point resolution when plain text precedes bullet points ([#123](https://github.com/getsentry/github-workflows/pull/123))
60
61
- Improve changelog generation for non-tagged commits and edge cases ([#115](https://github.com/getsentry/github-workflows/pull/115))
61
62
62
63
# # 2.14.1
Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ for ($i = 0; $i -lt $lines.Count; $i++)
97
97
throw " Prettier comment format - expected <!-- prettier-ignore-end -->, but found: '$line '"
98
98
}
99
99
# End of prettier comment
100
-
101
100
102
101
# Next, we expect a header
103
102
if (-not $line.StartsWith (" #" ))
@@ -180,9 +179,8 @@ for ($i = 0; $i -lt $sectionEnd; $i++)
180
179
if (! $updated )
181
180
{
182
181
# Find what character is used as a bullet-point separator - look for the first bullet-point object that wasn't created by this script.
183
- $bulletPoint = $lines | Where-Object { ($_ -match " ^ *[-*] " ) -and -not ($_ -match " (Bump .* to|\[changelog\]|\[diff\])" ) } | Select-Object - First 1
184
- $bulletPoint = " $bulletPoint -" [0 ]
185
-
182
+ $bulletPoint = $lines | Where-Object { ($_ -match ' ^ *[-*] ' ) -and -not ($_ -match ' (Bump .* to|\[changelog\]|\[diff\])' ) } | Select-Object - First 1
183
+ $bulletPoint = " $ ( $bulletPoint.Trim ()) -" [0 ]
186
184
$entry = @ (" $bulletPoint Bump $Name from $oldTagNice to $newTagNice ($PullRequestMD )" ,
187
185
" $bulletPoint [changelog]($RepoUrl /blob/$MainBranch /CHANGELOG.md#$tagAnchor )" ,
188
186
" $bulletPoint [diff]($RepoUrl /compare/$OldTag ...$NewTag )" )
Original file line number Diff line number Diff line change
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ### Breaking Changes
6
+
7
+ Updater and Danger reusable workflows are now composite actions ([#114](https://github.com/getsentry/github-workflows/pull/114))
8
+
9
+ To update your existing Updater workflows:
10
+ ```yaml
11
+ ### Before
12
+ native:
13
+ uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
14
+ with:
15
+ path: scripts/update-sentry-native-ndk.sh
16
+ name: Native SDK
17
+ secrets:
18
+ # If a custom token is used instead, a CI would be triggered on a created PR.
19
+ api-token: ${{ secrets.CI_DEPLOY_KEY }}
20
+
21
+ ### After
22
+ native:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: getsentry/github-workflows/updater@v3
26
+ with:
27
+ path: scripts/update-sentry-native-ndk.sh
28
+ name: Native SDK
29
+ api-token: ${{ secrets.CI_DEPLOY_KEY }}
30
+ ```
31
+
32
+ To update your existing Danger workflows:
33
+ ```yaml
34
+ ### Before
35
+ danger:
36
+ uses: getsentry/github-workflows/.github/workflows/danger.yml@v2
37
+
38
+ ### After
39
+ danger:
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: getsentry/github-workflows/danger@v3
43
+ ```
44
+
45
+ ### Dependencies
46
+
47
+ - Bump Dependency from v7.16.0 to v7.17.0 ([#123](https://github.com/getsentry/dependant/pulls/123))
48
+ - [changelog](https://github.com/getsentry/dependency/blob/main/CHANGELOG.md#7170)
49
+ - [diff](https://github.com/getsentry/dependency/compare/7.16.0...7.17.0)
50
+
51
+ ## 2.14.1
52
+
53
+ ### Features
54
+
55
+ - Do something ([#100](https://github.com/getsentry/dependant/pulls/100))
Original file line number Diff line number Diff line change
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ### Breaking Changes
6
+
7
+ Updater and Danger reusable workflows are now composite actions ([#114](https://github.com/getsentry/github-workflows/pull/114))
8
+
9
+ To update your existing Updater workflows:
10
+ ```yaml
11
+ ### Before
12
+ native:
13
+ uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
14
+ with:
15
+ path: scripts/update-sentry-native-ndk.sh
16
+ name: Native SDK
17
+ secrets:
18
+ # If a custom token is used instead, a CI would be triggered on a created PR.
19
+ api-token: ${{ secrets.CI_DEPLOY_KEY }}
20
+
21
+ ### After
22
+ native:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: getsentry/github-workflows/updater@v3
26
+ with:
27
+ path: scripts/update-sentry-native-ndk.sh
28
+ name: Native SDK
29
+ api-token: ${{ secrets.CI_DEPLOY_KEY }}
30
+ ```
31
+
32
+ To update your existing Danger workflows:
33
+ ```yaml
34
+ ### Before
35
+ danger:
36
+ uses: getsentry/github-workflows/.github/workflows/danger.yml@v2
37
+
38
+ ### After
39
+ danger:
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: getsentry/github-workflows/danger@v3
43
+ ```
44
+
45
+ ## 2.14.1
46
+
47
+ ### Features
48
+
49
+ - Do something ([#100](https://github.com/getsentry/dependant/pulls/100))
Original file line number Diff line number Diff line change @@ -15,4 +15,21 @@ Describe 'update-changelog' {
15
15
16
16
Get-Content " $testCase /CHANGELOG.md" | Should - Be (Get-Content " $testCase /CHANGELOG.md.expected" )
17
17
}
18
+
19
+ It ' should correctly detect bullet points when plain text appears before bullet points' {
20
+ $testCasePath = " $PSScriptRoot /testdata/changelog/plain-text-intro"
21
+ Copy-Item " $testCasePath /CHANGELOG.md.original" " $testCasePath /CHANGELOG.md"
22
+
23
+ pwsh - WorkingDirectory $testCasePath - File " $PSScriptRoot /../scripts/update-changelog.ps1" `
24
+ - Name ' Dependency' `
25
+ - PR ' https://github.com/getsentry/dependant/pulls/123' `
26
+ - RepoUrl ' https://github.com/getsentry/dependency' `
27
+ - MainBranch ' main' `
28
+ - OldTag ' 7.16.0' `
29
+ - NewTag ' 7.17.0' `
30
+ - Section ' Dependencies'
31
+
32
+ # verify the full output matches expected
33
+ Get-Content " $testCasePath /CHANGELOG.md" | Should - Be (Get-Content " $testCasePath /CHANGELOG.md.expected" )
34
+ }
18
35
}
You can’t perform that action at this time.
0 commit comments