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:
5757
5858# ## Fixes
5959
60+ - Updater - Fix bullet-point resolution when plain text precedes bullet points ([#123](https://github.com/getsentry/github-workflows/pull/123))
6061- Improve changelog generation for non-tagged commits and edge cases ([#115](https://github.com/getsentry/github-workflows/pull/115))
6162
6263# # 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++)
9797 throw " Prettier comment format - expected <!-- prettier-ignore-end -->, but found: '$line '"
9898 }
9999 # End of prettier comment
100-
101100
102101 # Next, we expect a header
103102 if (-not $line.StartsWith (" #" ))
@@ -180,9 +179,8 @@ for ($i = 0; $i -lt $sectionEnd; $i++)
180179if (! $updated )
181180{
182181 # 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 ]
186184 $entry = @ (" $bulletPoint Bump $Name from $oldTagNice to $newTagNice ($PullRequestMD )" ,
187185 " $bulletPoint [changelog]($RepoUrl /blob/$MainBranch /CHANGELOG.md#$tagAnchor )" ,
188186 " $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' {
1515
1616 Get-Content " $testCase /CHANGELOG.md" | Should - Be (Get-Content " $testCase /CHANGELOG.md.expected" )
1717 }
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+ }
1835}
You can’t perform that action at this time.
0 commit comments