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

Labels are not being added to my PR #365

Closed
1bberto opened this issue May 12, 2022 · 4 comments
Closed

Labels are not being added to my PR #365

1bberto opened this issue May 12, 2022 · 4 comments

Comments

@1bberto
Copy link

1bberto commented May 12, 2022

I have the following configuration:

.github/labeler.yml

'labelA':
  - any: ['**/*.{sql,sqlproj}', '/DbSchema/SchemaMigrations/**', '/OS.DB/**']
    all: ['!/QA/**']
'labelB':
  - any: ['**/*.{config,cs,cshtml,csproj,sln,bat,cfg,dll,exe,ndproj,ps1,rb,sh}', 'Scripts/**/*', 'Utils/**/*', 'VSProjects/**/*', 'Rakefile', '.sonarlint/**', '.editorconfig', '.gitignore', '.gitattributes']
    all: ['!QA/**/*']
'labelC':
  - any: ['**/*.{css,html,js,sass,scss,ts,json}', 'WebSrc/**/*', '.eslintignore', '.sonarlint/**/*', 'husky/**/*', '.editorconfig', '.gitignore', '.gitattributes']
    all: ['!QA/**/*']
'labelD':
  - all: ['QA/**/*']
'labelE':
  - any: ['**/*.{yaml,yml}', '.github/**/*', 'helm/**/*']

for some reason the labels are not being added to the PR and are also being removed when I add the labels manually

@davidhunt135
Copy link

davidhunt135 commented May 26, 2022

This appears to be cause by using 'any' and 'all'

This works for me:

label:
  - 'glob'
  - 'glob'

This doesn't

label:
- any: ['glob', 'glob']

@tn3rb
Copy link

tn3rb commented Jun 14, 2022

from the readme:

Unlike the top-level list, the list of path globs provided to any and all must ALL match against a path for the label to be applied.

my guess is that your rules are conflicting,
ie: your rule for labelA can not satisfy both '/DbSchema/SchemaMigrations/**' and '/OS.DB/**' because a file can not exist in both of those folders at the same time.

so in other words, you need to split those up, ie: what @davidhunt135 said

maybe try:

'labelA':
  - any: ['**/*.{sql,sqlproj}', '/DbSchema/SchemaMigrations/**']
    all: ['!/QA/**']
  - any: ['**/*.{sql,sqlproj}', '/OS.DB/**']
    all: ['!/QA/**']

@MaksimZhukov
Copy link
Contributor

MaksimZhukov commented Oct 31, 2022

Hello @1bberto !
Have you had a chance to figure out why your labels are not added to PR? Is the issue still relevant to you?

Likely, your labels are removed due to the bug in the labeler repository. The sync-labels input does not work properly. By default, its value is true. Please use the following workaround until the bug is fixed:

sync-labels: ''

Sorry for the inconvenience!

@MaksimZhukov
Copy link
Contributor

I’m closing the issue. Please let us know if you have any concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants