Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ To update your existing Danger workflows:

### Fixes

- Updater - Fix bullet-point resolution when plain text precedes bullet points ([#123](https://github.com/getsentry/github-workflows/pull/123))
- Improve changelog generation for non-tagged commits and edge cases ([#115](https://github.com/getsentry/github-workflows/pull/115))

## 2.14.1
Expand Down
6 changes: 2 additions & 4 deletions updater/scripts/update-changelog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ for ($i = 0; $i -lt $lines.Count; $i++)
throw "Prettier comment format - expected <!-- prettier-ignore-end -->, but found: '$line'"
}
# End of prettier comment


# Next, we expect a header
if (-not $line.StartsWith("#"))
Expand Down Expand Up @@ -180,9 +179,8 @@ for ($i = 0; $i -lt $sectionEnd; $i++)
if (!$updated)
{
# Find what character is used as a bullet-point separator - look for the first bullet-point object that wasn't created by this script.
$bulletPoint = $lines | Where-Object { ($_ -match "^ *[-*] ") -and -not ($_ -match "(Bump .* to|\[changelog\]|\[diff\])") } | Select-Object -First 1
$bulletPoint = "$bulletPoint-"[0]

$bulletPoint = $lines | Where-Object { ($_ -match '^ *[-*] ') -and -not ($_ -match '(Bump .* to|\[changelog\]|\[diff\])') } | Select-Object -First 1
$bulletPoint = "$($bulletPoint.Trim())-"[0]
$entry = @("$bulletPoint Bump $Name from $oldTagNice to $newTagNice ($PullRequestMD)",
" $bulletPoint [changelog]($RepoUrl/blob/$MainBranch/CHANGELOG.md#$tagAnchor)",
" $bulletPoint [diff]($RepoUrl/compare/$OldTag...$NewTag)")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Changelog

## Unreleased

### Breaking Changes

Updater and Danger reusable workflows are now composite actions ([#114](https://github.com/getsentry/github-workflows/pull/114))

To update your existing Updater workflows:
```yaml
### Before
native:
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
with:
path: scripts/update-sentry-native-ndk.sh
name: Native SDK
secrets:
# If a custom token is used instead, a CI would be triggered on a created PR.
api-token: ${{ secrets.CI_DEPLOY_KEY }}

### After
native:
runs-on: ubuntu-latest
steps:
- uses: getsentry/github-workflows/updater@v3
with:
path: scripts/update-sentry-native-ndk.sh
name: Native SDK
api-token: ${{ secrets.CI_DEPLOY_KEY }}
```

To update your existing Danger workflows:
```yaml
### Before
danger:
uses: getsentry/github-workflows/.github/workflows/danger.yml@v2

### After
danger:
runs-on: ubuntu-latest
steps:
- uses: getsentry/github-workflows/danger@v3
```

### Dependencies

- Bump Dependency from v7.16.0 to v7.17.0 ([#123](https://github.com/getsentry/dependant/pulls/123))
- [changelog](https://github.com/getsentry/dependency/blob/main/CHANGELOG.md#7170)
- [diff](https://github.com/getsentry/dependency/compare/7.16.0...7.17.0)

## 2.14.1

### Features

- Do something ([#100](https://github.com/getsentry/dependant/pulls/100))
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Changelog

## Unreleased

### Breaking Changes

Updater and Danger reusable workflows are now composite actions ([#114](https://github.com/getsentry/github-workflows/pull/114))

To update your existing Updater workflows:
```yaml
### Before
native:
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
with:
path: scripts/update-sentry-native-ndk.sh
name: Native SDK
secrets:
# If a custom token is used instead, a CI would be triggered on a created PR.
api-token: ${{ secrets.CI_DEPLOY_KEY }}

### After
native:
runs-on: ubuntu-latest
steps:
- uses: getsentry/github-workflows/updater@v3
with:
path: scripts/update-sentry-native-ndk.sh
name: Native SDK
api-token: ${{ secrets.CI_DEPLOY_KEY }}
```

To update your existing Danger workflows:
```yaml
### Before
danger:
uses: getsentry/github-workflows/.github/workflows/danger.yml@v2

### After
danger:
runs-on: ubuntu-latest
steps:
- uses: getsentry/github-workflows/danger@v3
```

## 2.14.1

### Features

- Do something ([#100](https://github.com/getsentry/dependant/pulls/100))
17 changes: 17 additions & 0 deletions updater/tests/update-changelog.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,21 @@ Describe 'update-changelog' {

Get-Content "$testCase/CHANGELOG.md" | Should -Be (Get-Content "$testCase/CHANGELOG.md.expected")
}

It 'should correctly detect bullet points when plain text appears before bullet points' {
$testCasePath = "$PSScriptRoot/testdata/changelog/plain-text-intro"
Copy-Item "$testCasePath/CHANGELOG.md.original" "$testCasePath/CHANGELOG.md"

pwsh -WorkingDirectory $testCasePath -File "$PSScriptRoot/../scripts/update-changelog.ps1" `
-Name 'Dependency' `
-PR 'https://github.com/getsentry/dependant/pulls/123' `
-RepoUrl 'https://github.com/getsentry/dependency' `
-MainBranch 'main' `
-OldTag '7.16.0' `
-NewTag '7.17.0' `
-Section 'Dependencies'

# verify the full output matches expected
Get-Content "$testCasePath/CHANGELOG.md" | Should -Be (Get-Content "$testCasePath/CHANGELOG.md.expected")
}
}
Loading