Label creation adds unwanted default labels
See original GitHub issueDescribe the bug
When I run npx auto create-labels
and have a given label configuration defined in my package.json, I would expect that only those labels get created, NOT the additional default labels defined by auto. This used to be the case but somewhere along the line stopped working correctly.
To Reproduce
Using the following configuration:
"auto": {
"baseBranch": "master",
"prereleaseBranches": [
"next"
],
"plugins": [
[
"npm",
{
"legacyAuth": true,
"setRcToken": false
}
],
"released",
"microsoft-teams"
],
"shipit": {
"noChangelog": true
},
"labels": [
{
"name": "breaking",
"changelogTitle": "🚨 Breaking Changes",
"description": "Backwards incompatible enhancement or feature.",
"releaseType": "major",
"color": "#c5000b"
},
{
"name": "feature",
"changelogTitle": "🚀 Features",
"description": "A new feature.",
"releaseType": "minor",
"color": "#00ff00"
},
{
"name": "build",
"changelogTitle": "📦 Build Process",
"description": "Changes to the build process.",
"releaseType": "patch",
"color": "#4a4a4a"
},
{
"name": "chore",
"changelogTitle": "🏗 Miscellaneous",
"description": "Additional, uncategorized changes.",
"releaseType": "patch",
"color": "#ff00ff",
"default": true
},
{
"name": "ci",
"changelogTitle": "🔖 Continuous Integration",
"description": "Changes to CI configuration files and scripts.",
"releaseType": "patch",
"color": "#f1a60e"
},
{
"name": "docs",
"changelogTitle": "📖 Documentation",
"description": "Documentation updates and changes.",
"releaseType": "patch",
"color": "#870048"
},
{
"name": "fix",
"changelogTitle": "🐛 Bug Fixes",
"description": "A bug fix.",
"releaseType": "patch",
"color": "#6000ff"
},
{
"name": "perf",
"changelogTitle": "⚡️ Performance",
"description": "A code change that improves performance.",
"releaseType": "patch",
"color": "#00e4ff"
},
{
"name": "refactor",
"changelogTitle": "♻️ Refactoring",
"description": "A code change that neither fixes a bug nor adds a feature.",
"releaseType": "patch",
"color": "#00b58d"
},
{
"name": "revert",
"changelogTitle": "🚧 Reverting",
"description": "Reverts a previous commit.",
"releaseType": "patch",
"color": "#ff9000"
},
{
"name": "style",
"changelogTitle": "🎨 Style",
"description": "Code style (white-space, formatting, missing semi-colons, etc).",
"releaseType": "patch",
"color": "#0051d8"
},
{
"name": "test",
"changelogTitle": "✅ Testing",
"description": "Adding missing tests or correcting existing tests.",
"releaseType": "patch",
"color": "#127f00"
},
{
"name": "upgrade",
"changelogTitle": "⚙️ Dependencies",
"description": "Dependency upgrades.",
"releaseType": "minor",
"color": "#00787f"
}
]
}
This is the output:
Created labels: breaking, feature, build, chore, ci, docs, fix, perf, refactor, revert, style, test, upgrade, major, minor, patch, skip-release, internal, documentation, tests, dependencies, performance, released, prerelease
Expected behavior
Only the labels outlined in the above config would be created. Anything after the upgrade
label in the above output list is unwanted and should not be created.
Screenshots
Environment information:
Environment Information:
"auto" version: v10.25.1
"git" version: v2.29.2
"node" version: v12.13.0
✔ Labels configured on GitHub project
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Solved: For label is it possilble to set a default value
Go to Project Settings > Project Automation (on left-hand menu) · Press Create Rule in top-right corner · Select the Trigger "Issue Created"...
Read more >Default label size - Microsoft Community
Is there a way to set a default label size when printing either one ... Labels tab of the Envelopes and Labels dialog,...
Read more >Labels - GitLab Docs
The list of labels includes both the labels created in the project and ... Add the new label to issues, merge requests, and...
Read more >Labels - OCLC Support
Navigate to Tools > Options > Printing. · Under Labels, select a printer in the Label Printer list. Default: Your default printer in...
Read more >Create, add, and remove labels in Writer - Zoho Cares
Click Add or remove labels located below Labels. You will find just Add label link if no labels have been added to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@reintroducing I like that option a lot! Default can be only create specified labels. New flag to include the others and use the overwrite logic. This would be a breaking change to behavior though. What about the opposite
--no-include-defaults
?@hipstersmoothie So looking at those docs, I guess I’m unclear about the functionality of that option. I would assume that if I add that to every one of my labels in my config, it would just overwrite the
major
,minor
, andpatch
labels with mine, but would not clear out the others that are being created in addition to those. I think a nice addition would be to add an option to thecreate labels
command that saysinclude-defaults
and set to true/false (true by default if you want to keep backwards compatibility). Thoughts?