Comments (12)
Hi, sorry I totally missed this issue. I will take a closer look into this in the coming days. Thanks for reporting.
from labeler.
That would be great, thank you! Please see https://github.com/vmware-tanzu/vm-operator/blob/3ebc8097d391c2356073d7c327b1b0f72d44f5b0/.github/workflows/pr-labeler.yml#L12-L33 for more information.
from labeler.
Tested in a test repository of my own, and it looks like the mentioned regex pattern is not appropriately dealt with:
type:BookStyle:
files:
- "^Latex/[^/]*"
2021/11/21 00:47:15 Unable to unmarshall legacy config: yaml: unmarshal errors:
line 3: cannot unmarshal !!seq into labeler.LabelMatcher
line 5: cannot unmarshal !!seq into labeler.LabelMatcher
line 7: cannot unmarshal !!seq into labeler.LabelMatcher
line 9: cannot unmarshal !!seq into labeler.LabelMatcher
line 11: cannot unmarshal !!seq into labeler.LabelMatcher
line 15: cannot unmarshal !!seq into labeler.LabelMatcher
Looks like the regex cannot be read properly in here (?):
https://github.com/srvaroa/labeler/blob/master/cmd/action.go#L102
Does addressing this look doable @srvaroa ? Thanks for the effort.
from labeler.
Mentioned in vmware-tanzu/vm-operator#50 (review) (this was not added automatically for some reason)
from labeler.
@jhlegarreta, @akutz: I believe this thread might be helpful to you:
As this GitHub Action is written in Go (Golang), handling regular expressions (Regex) requires a bit of extra care. Specifically, you'll need to escape special characters using double backslashes. This is because the backslash in Go strings is an escape character and therefore must be escaped itself.
Here's an example that should work:- label: "File" files: - ".*\\/subfolder\\/.*\\.md"To clarify this, I've submitted PR (#129) that updates the documentation accordingly.
Originally posted by @philippwaller in #50 (comment)
@srvaroa: Presumably, this is about the same issue.
from labeler.
Yeah, I will add a couple of test cases to prove the examples provided above.
from labeler.
@philippwaller thanks for the heads-up; @srvaroa thanks for the documentation; I will try to test it as time permits.
from labeler.
It is unclear if this actually adds support for excluding file patterns. The negate
option does not really work either. We need a way to express:
Apply this label if CONDITION except for GENERATED FILES
Essentially we want to apply labels based on the size of the change, but the size should not be calculated based on changes related to generated content.
from labeler.
@akutz the size
condition supports an exclude-files
option for this purpose. Right now this only supports explicit exclusions but I could turn it into a regex if that's what you need.
from labeler.
@jhlegarreta @akutz this should deal with the exclusions in the Size condition. There is an example that should be reasonably understandable in the tests. Let me knot if this looks good for you and I'll get this released asap.
from labeler.
@jhlegarreta I have added a couple of tests to verify the conditions you quoted above. It looks like the expressions work correctly after escaping the characters.
Let me know if that solves your use case.
Tests here -> https://github.com/srvaroa/labeler/pull/132/files#diff-133334d6ef7baf3e8c0bc80d52a8a7c185e1fca8345190d244e4c7c66ee89925R537
from labeler.
I will close this for now, but @jhlegarreta do let me know if your issue is still not solved.
from labeler.
Related Issues (20)
- `appendOnly: true` doesn't seem to work HOT 4
- ~~What flavour of regex is being used ?~~ README: add info about using escape character in regexes HOT 3
- `fail_on_error: true` doesn't seem to work HOT 4
- Could a "moving" `v1` tag be added to this repo ? HOT 2
- 1.8.0 release failed HOT 2
- Enhanced label customization HOT 2
- author-can-merge: false does not seem to work HOT 13
- [Feature] Label only if unlabled
- [Feature] Apply labels based on author's team membership HOT 1
- feat: calculate age based on modification date HOT 1
- feat: add a more comprehensive labeler example for self-use and demonstration HOT 2
- Add support for issues HOT 5
- [Feature] Naming labels based on regex capture groups HOT 1
- Ignore files in PR Size condition HOT 3
- Semantic versioning HOT 5
- [Feature] support local config file HOT 2
- Cannot run the action since 1.6.2 release: action.tar.gz not found HOT 4
- [Labeler] job no more working -- Docker build failed with exit code 1 HOT 2
- Avoid referencing `latest` in Dockerfile HOT 2
- label based on name of PR target branch HOT 3
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.