Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev -> main #686

Merged
merged 7 commits into from
Feb 11, 2022
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
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ This configuration is a `.json` file in the following format.
},
{
"title": "## 🧪 Tests",
"labels": ["test"]
"labels": ["test"],
},
{
"title": "## 🧪 Tests and some 🪄 Magic",
"labels": ["test", "magic"],
"exclude_labels": ["no-magic"],
"exhaustive": true,
}
],
"ignore_labels": [
Expand Down Expand Up @@ -307,9 +313,10 @@ Table of descriptions for the `configuration.json` options to configure the resu

| **Input** | **Description** |
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| categories | An array of `category` specifications, offering a flexible way to group changes into categories |
| category.title | The display name of a category in the changelog |
| category.labels | An array of labels, to match pull request labels against. If any PR label matches any category label, the pull request will show up under this category |
| categories | An array of `category` specifications, offering a flexible way to group changes into categories. |
| category.title | The display name of a category in the changelog. |
| category.labels | An array of labels, to match pull request labels against. If any PR label matches any category label, the pull request will show up under this category. |
| category.exclude_labels | Similar to `labels`, an array of labels to match PRs against, but if a match occurs the PR is excluded from this category. |
| category.exhaustive | Will require all labels defined within this category to be present on the matching PR. |
| ignore_labels | An array of labels, to match pull request labels against. If any PR label overlaps, the pull request will be ignored from the changelog. This takes precedence over category labels |
| sort | The sort order of pull requests. [ASC, DESC] |
Expand Down
37 changes: 37 additions & 0 deletions __tests__/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,4 +448,41 @@ it('Release Diff', async () => {
expect(resultChangelog).toStrictEqual(
`https://github.com/mikepenz/release-changelog-builder-action/compare/v2.8.0...v2.8.1`
)
})


it('Use exclude labels to not include a PR within a category.', async () => {
const customConfig = Object.assign({}, DefaultConfiguration)
customConfig.categories = [
{
title: '## 🚀 Features and 🐛 Issues',
labels: ['Feature', 'Issue'],
exhaustive: true
},
{
title: '## 🚀 Features and 🐛 Issues But No 🐛 Fixes',
labels: ['Feature', 'Issue'],
exclude_labels: ['Fix'],
exhaustive: true
},
{
title: '## 🚀 Features and/or 🐛 Issues But No 🐛 Fixes',
labels: ['Feature', 'Issue'],
exclude_labels: ['Fix']
}
]

const resultChangelog = buildChangelog(pullRequestsWithLabels, {
owner: 'mikepenz',
repo: 'test-repo',
fromTag: '1.0.0',
toTag: '2.0.0',
failOnError: false,
commitMode: false,
configuration: customConfig
})

expect(resultChangelog).toStrictEqual(
`## 🚀 Features and 🐛 Issues\n\n- [ABC-1234] - this is a PR 3 title message\n - PR: #3\n\n## 🚀 Features and/or 🐛 Issues But No 🐛 Fixes\n\n- [ABC-1234] - this is a PR 1 title message\n - PR: #1\n\n`
)
})
12 changes: 12 additions & 0 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