Skip to content

Commit

Permalink
Merge pull request #293 from mikepenz/develop
Browse files Browse the repository at this point in the history
dev -> main
  • Loading branch information
mikepenz authored Apr 30, 2021
2 parents 161e90d + 358e95d commit 5f113b5
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 228 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ This configuration is a `.json` file in the following format.
],
"tag_resolver": {
"method": "semver"
}
},
"base_branches": [
"dev"
]
}
```

Expand Down Expand Up @@ -301,6 +304,7 @@ Table of descriptions for the `configuration.json` options to configure the resu
| exclude_merge_branches | An array of branches to be ignored from processing as merge commits |
| tag_resolver | Section to provide configuration for the tag resolving logic. Used if no `fromTag` is provided |
| tag_resolver.method | Defines the method to use. Current options are: `semver`, `sort`. Default: `semver` |
| base_branches | The target branches for the merged PR, ingnores PRs with different target branch. Values can be a `regex`. Default: allow all base branches

## Contribute 🧬

Expand Down
40 changes: 40 additions & 0 deletions __tests__/releaseNotes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,43 @@ it('Should match ordered DESC', async () => {
`## 🚀 Features\n\n28\n26\n25\n24\n22\n\n## 🐛 Fixes\n\n23\n\n`
)
})

it('Should ignore PRs not merged into develop branch', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_base_branches_develop.json'
)
const releaseNotes = new ReleaseNotes(octokit, {
owner: 'mikepenz',
repo: 'release-changelog-builder-action',
fromTag: 'v1.3.1',
toTag: 'v1.4.0',
failOnError: false,
commitMode: false,
configuration: configuration
})

const changeLog = await releaseNotes.pull()
console.log(changeLog)
expect(changeLog).toStrictEqual(`\n\n150\n\n`)
})

it('Should ignore PRs not merged into main branch', async () => {
const configuration = resolveConfiguration(
'',
'configs_test/configuration_base_branches_main.json'
)
const releaseNotes = new ReleaseNotes(octokit, {
owner: 'mikepenz',
repo: 'release-changelog-builder-action',
fromTag: 'v1.3.1',
toTag: 'v1.4.0',
failOnError: false,
commitMode: false,
configuration: configuration
})

const changeLog = await releaseNotes.pull()
console.log(changeLog)
expect(changeLog).toStrictEqual(`\n\n153\n\n`)
})
24 changes: 24 additions & 0 deletions configs_test/configuration_base_branches_develop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"categories": [
{
"title": "",
"labels": [
"dev",
"Bump"
]
}
],
"ignore_labels": [],
"sort": "DESC",
"pr_template": "${{NUMBER}}",
"label_extractor": [
{
"pattern": ".*(dev|Bump).*",
"target": "$1",
"on_property": "title"
}
],
"base_branches": [
"develop"
]
}
24 changes: 24 additions & 0 deletions configs_test/configuration_base_branches_main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"categories": [
{
"title": "",
"labels": [
"dev",
"Bump"
]
}
],
"ignore_labels": [],
"sort": "DESC",
"pr_template": "${{NUMBER}}",
"label_extractor": [
{
"pattern": ".*(dev|Bump).*",
"target": "$1",
"on_property": "title"
}
],
"base_branches": [
"main"
]
}
20 changes: 18 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 5f113b5

Please sign in to comment.