Skip to content

Commit 20d5185

Browse files
committed
Refactor
1 parent 8444507 commit 20d5185

File tree

4 files changed

+21
-31
lines changed

4 files changed

+21
-31
lines changed

.github/workflows/check-release-notes-scripts.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@ name: Check "check-release-notes" action ans scripts
55
on:
66
pull_request:
77
types: [opened, edited, synchronize]
8-
# we run against PR branch if workflow/scripts are changed (to check changes)
9-
# and against master branch otherwise (to apply up-to-date rules)
10-
#
11-
# paths should be the same as in [check-release-notes.yml]
8+
# - run against the PR branch if workflow/scripts are changed (to verify and apply new rules in scripts)
129
paths:
13-
- '.github/workflows/check-release-notes-reusable.yml'
14-
- '.github/workflows/check-release-notes-reusable-check.yml'
15-
- 'tools'
10+
- 'tools/changelog'
1611

1712
jobs:
1813
check:
1914
runs-on: ubuntu-24.04
2015
steps:
21-
- uses: JetBrains/compose-multiplatform/.github/actions/check-release-notes
16+
- uses: JetBrains/compose-multiplatform/.github/actions/check-release-notes-github-action
2217
with:
2318
checkout_ref: '$GITHUB_REF'
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
# Checks Release Notes in the PR description, runs with rules from the main branch, when:
1+
# Checks Release Notes in the PR description, runs with rules from the master branch, when:
22
# opened - PR is opened
33
# edited - The title/description are changed
44
# synchronize - New commits appeared.
5-
# We don't use the new content, but we still need to mark this commit Green in GitHub UI
5+
# We don't use the new content, but we still need to mark this commit Green/Red in GitHub UI
66

77
name: Check Release Notes in the description
88
on:
99
pull_request:
1010
types: [opened, edited, synchronize]
11-
# we run against PR branch if workflow/scripts are changed (to check changes)
12-
# and against master branch otherwise (to apply up-to-date rules)
13-
#
14-
# paths should be the same as in [check-release-notes-scripts.yml]
15-
# paths-ignore:
16-
# - '.github/workflows/check-release-notes-reusable.yml'
17-
# - '.github/workflows/check-release-notes-reusable-check.yml'
18-
# - 'changelog.main.kts'
11+
# - run against master branch if workflow/scripts aren't changed (to apply up-to-date rules to all PRs)
12+
paths-ignore:
13+
- 'tools/changelog'
1914

2015
jobs:
2116
check:
2217
runs-on: ubuntu-24.04
2318
steps:
24-
- uses: JetBrains/compose-multiplatform/tools/changelog/check-release-notes@igordmn-patch-7
19+
- uses: JetBrains/compose-multiplatform/tools/changelog/check-release-notes-github-action@igordmn-patch-7
2520
with:
2621
checkout_ref: 'igordmn-patch-7'

tools/changelog/changelog.main.kts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,18 @@ fun GitHubPullEntry.extractReleaseNotes(): ReleaseNotes? {
322322

323323
// extract body inside "# Release Notes"
324324
val relNoteBody = body
325-
?.replace("# Release notes", "# Release Notes", ignoreCase = true)
326-
?.replace("#Release notes", "# Release Notes", ignoreCase = true)
327-
?.replace("# RelNote", "# Release Notes", ignoreCase = true)
328-
?.run {
329-
substringBetween("# Release Notes", "\n# ")
330-
?: substringBetween("## Release Notes", "\n## ")
331-
?: substringBetween("### Release Notes", "\n### ")
332-
?: substringBetween("## Release Notes", "\n# ")
333-
?: substringBetween("### Release Notes", "\n## ")
334-
?: substringBetween("### Release Notes", "\n# ")
335-
}
336-
?.trim()
325+
?.replace("# Release notes", "# Release Notes", ignoreCase = true)
326+
?.replace("#Release notes", "# Release Notes", ignoreCase = true)
327+
?.replace("# RelNote", "# Release Notes", ignoreCase = true)
328+
?.run {
329+
substringBetween("# Release Notes", "\n# ")
330+
?: substringBetween("## Release Notes", "\n## ")
331+
?: substringBetween("### Release Notes", "\n### ")
332+
?: substringBetween("## Release Notes", "\n# ")
333+
?: substringBetween("### Release Notes", "\n## ")
334+
?: substringBetween("### Release Notes", "\n# ")
335+
}
336+
?.trim()
337337

338338
if (relNoteBody == null) return null
339339
if (relNoteBody.trim().lowercase() == "n/a") return ReleaseNotes.NA
File renamed without changes.

0 commit comments

Comments
 (0)