labeler icon indicating copy to clipboard operation
labeler copied to clipboard

Action does not match folders starting with dot (.)

Open ibratoev opened this issue 3 years ago β€’ 8 comments

Actual:

  • if I have a change in a folder src/.deploy and matcher for src/**/* it would not be matched.

Expected:

  • folders starting with dot should be matched as well.

It seems the issue is related to how Minimatch works. See https://github.com/isaacs/minimatch/issues/30 . Consider passing {dot: true} by default.

ibratoev avatar Apr 06 '21 08:04 ibratoev

I'm just giving it a wild guess, would it be just to add that parameter to these two lines?

const matchers = globs.map(g => new Minimatch(g, {dot: true})); 

https://github.com/actions/labeler/blob/69990a6043bd2b78ec675ec775d8e1cb62204ff0/src/main.ts#L187 https://github.com/actions/labeler/blob/69990a6043bd2b78ec675ec775d8e1cb62204ff0/src/main.ts#L202

alfieyfc avatar Apr 08 '21 11:04 alfieyfc

actually I'm having issues even with root level configuration like: - ./*.js which seems to be not working. anyone did manage to make it work?

mcieplucha avatar Apr 12 '21 11:04 mcieplucha

been 5 months already, any update on this?

6thpath avatar Sep 17 '21 09:09 6thpath

How about adding a new action param to make the fix non-breaking?

    - uses: actions/labeler@v3
      with:
        repo-token: "${{ secrets.GITHUB_TOKEN }}"
+       dot: true

Happy to work on the PR if anyone reading this comment has capacity to review it and cut a release. Alternatively, we can just add { dot: true } to minimatch and release version 4.


Our current .github/labeler.yml in hashintel/hash is pretty long because of this issue:

packages/foo:
  - packages/foo/*
  - packages/foo/.*
  - packages/foo/**/*
  - packages/foo/**/.*

# ↑ repeat Γ—20

πŸ˜”

kachkaev avatar Nov 24 '21 16:11 kachkaev

How is the status of this?

boliveira avatar Nov 25 '21 11:11 boliveira

Would also love to see a fix for this πŸ™

beefchimi avatar Jan 06 '22 22:01 beefchimi

My company uses this action and is also encountering this issue. Seems like this is a pretty simple update, would it be possible to get this out soon?

logicbomb421 avatar Jan 29 '22 02:01 logicbomb421

Today we were configuring labels in blockprotocol/blockprotocol and I was like β€˜oh no not this dot problem again’ πŸ˜…

So here is the fix: https://github.com/actions/labeler/pull/316. It is non-breaking, just allows us to set the dot input:

 name: "Pull Request Labeler"
 on:
 - pull_request_target

 jobs:
   triage:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/labeler@v3
       with:
+        dot: true
         repo-token: "${{ secrets.GITHUB_TOKEN }}"

I hope it will become available for everyone soon! 🀞

kachkaev avatar Feb 04 '22 13:02 kachkaev

The solution to this confusing issue has been up for nearly 10 months: https://github.com/actions/labeler/pull/316 πŸ˜” Any chance we can get it merged before NY2023? 🀞

In the meantime I am using my own fork in one repo:

    steps:
      - uses: kachkaev/labeler@305cfeb74cfa5c4878bf6418b4815a4106f2e345
        ## @todo replace with actions/labeler@v4 (or newer) when this PR is merged:
        ## https://github.com/actions/labeler/pull/316
        with:
          dot: true
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

This works but does not let me stay up to date with other potential updates in actions/labeler. I'd love to switch back to the original action when dot option is released.

kachkaev avatar Nov 30 '22 19:11 kachkaev

Hello everyone! We have released a new version of the action with this feature on board. Thank you for the patience!

MaksimZhukov avatar Jun 06 '23 16:06 MaksimZhukov

futurama-good-news-everyone

The dot option is true by default in v5 πŸŽ‰ Release notes: https://github.com/actions/labeler/releases/tag/v5.0.0

kachkaev avatar Dec 05 '23 21:12 kachkaev