Comments (10)
The commit-specific matching might be more work, as it would require fetching all the commits that are contained in the PR, but the PR title and body should be already available.
What about adding a label config object item like pr: { body?: StringOrMatchConfig[], title?: StringOrMatchConfig[] }
?
Ex:
# Add 'test' label to any change to *.spec.js files within the source dir
# or with a PR title that is in the form 'test:*'
# or with a PR body that contains the word 'test' but not 'bug'
test:
- src/**/*.spec.js
- pr:
title:
- 'test:*'
body:
- any: [ '*test*' ]
all: [ '*bug*' ]
This could then be expanded to include the commits:
# Add 'test' label to any change to *.spec.js files within the source dir
# or with a PR title that is in the form 'test:*'
# or with a PR body that contains the word 'test' but not 'bug'
# or has any commits with a title in the form 'test:*'
test:
- src/**/*.spec.js
- pr:
title:
- 'test:*'
body:
- any: [ '*test*' ]
all: [ '*bug*' ]
- commits:
title:
- 'test:*'
In typescript, this could then be modeled like:
export interface MatchConfig {
all?: string[];
any?: string[];
}
export type MatchConfigEntry = string | MatchConfig;
export interface PRConfigEntry {
title?: MatchConfigEntry[];
body?: MatchConfigEntry[];
}
export type ConfigEntry = MatchConfigEntry | { pr: PRConfigEntry };
export interface Config {
[label: string]: ConfigEntry[];
}
const config: Config = {
// ...
test: [
'src/**/*.spec.js',
{
pr: {
title: ['test:*'],
body: [
{
any: ['*test*'],
all: ['*bug*']
}
]
}
}
]
// ...
}
from labeler.
Release Drafter already has the auto-labeling feature, see https://github.com/release-drafter/release-drafter#autolabeler
Sadly, AFAIK, it does not have the ability to be used as a check that prevent a change from being merged if is missing the right labels.
from labeler.
Can we also have the ability to specifically label based on git commit footers, e.g.
chore(foo): my fix
Risk: D
Urgency: 2
Signed-off-by: Silas Davis <[email protected]>
This would play nicely with conventional commits (https://www.conventionalcommits.org/en/v1.0.0/#specification), for example.
from labeler.
+1
from labeler.
+1
from labeler.
+1
from labeler.
Could this feature be expanded to let the labeler read the commit message, so for example, if a repo is following commitizen, we can tag PRs (and eventually issues), with the type of commit?
for example:
test: 💍 Remove test for untestable code, due to environment
would then add a test
label
from labeler.
Hi, would it be acceptable to instead of the structured way, "simply" to add an optional prefix on the blob?
For example:
label1:
- "body:#potato"
Would add the label "label1" if the body contains the string #potato
Looking at the code, this would be simpler to add, and from the user experience point of view I think it works ok to?
from labeler.
I like that, would be extremely useful!
from labeler.
@MaksimZhukov should I make another for 5.0 branch? is there any hope that this will be merged to 4.0?
#688
from labeler.
Related Issues (20)
- Multiple path matches are not correctly displayed as a label HOT 3
- Label not getting applied when changes are to files deeper than 4 levels HOT 4
- https://install.pocketgeekmobile.com/?Tm_campaign=apprating&utm_medium=in_app HOT 1
- [email protected] HOT 1
- No output HOT 7
- Adding label and logging when paths aren't matched HOT 3
- A `only` filter HOT 2
- Netatmo zusatz Innenmodul HOT 1
- sync-labels is (but shouldn't be) mandatory for jobs HOT 4
- Update default runtime to node20 HOT 2
- `Error: HttpError: Not Found` on v5 when using the `configuration-path` input HOT 4
- Dynamic label creation from path HOT 2
- found unexpected type for label 'xxxxxxxx' (should be array of config options) HOT 4
- Error: found unexpected type for label 'xxx' (should be array of config options) HOT 26
- Sync not working on labels with exceptions HOT 3
- Simpler structure for configuration. HOT 8
- Labeler does not work when i change tha base branch HOT 2
- Getting `sync-labels` type error after update to 5 version. HOT 4
- Create dynamic labels from branch name HOT 1
- any-glob-all-files does not working intuitevely HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labeler.