labeler icon indicating copy to clipboard operation
labeler copied to clipboard

How to add labels regardless of file path

Open tregismoreira opened this issue 2 years ago • 1 comments

Hello, and thanks for your contribution.

I've been trying to add the labels needs code review and needs functional test to a pull request when it is open, regardless of the file match. I tried this content in my .github/labeler.yml:

needs code review:
- '*'

needs functional test:
- '*'

But it did not work.

Can anybody help me?

Thanks in advance.

tregismoreira avatar Jun 20 '22 19:06 tregismoreira

I'm having the same issue. Here's the debug log output

##[debug] checking pattern "*" ##[debug] checking "any" patterns ##[debug] matching patterns against file ci/pre-build/unit-tests.yaml ##[debug] - * ##[debug] * did not match ##[debug] matching patterns against file ci/scripts/run-unit-tests.sh ##[debug] - * ##[debug] * did not match ##[debug] "any" patterns did not match any files

# .github/labeler.yml
foo:
  - "*"
# .github/workflows/labeler.yml
name: "Pull Request Labeler"
on:
  - pull_request_target

jobs:
  triage:
    permissions:
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/labeler@v4
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

tillydray avatar Jun 30 '22 20:06 tillydray

Hello @tregismoreira and @JasonMFry ! The '*' glob will match only root file changes. If you want to add a label when changing a file in sub folder, you should use '**/*' glob.

MaksimZhukov avatar Oct 28 '22 13:10 MaksimZhukov

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

MaksimZhukov avatar Dec 12 '22 07:12 MaksimZhukov