Issue of the label configuration file ".github/labeler.yml"
See original GitHub issueAssociated GitHub Community ticket: https://github.community/t/labeler-typeerror-glob-pattern-string-required/133467
According to the README of this action, the following configurations in the label configuration file should work:
label-1:
- any: ['list', 'of', 'globs']
all: ['list', 'of', 'globs']
label-2:
- example1/*
- example2/**/*
I tested with two label configuration files in my repository (see here).
- .github/labeler-01.yml
common: - any: ['./*', './src/**'] workflow: - any: ['.github/workflows/**'] - .github/labeler-02.yml
repo: - './*' - './src/**' GHA: - '.github/**'
And my workflow looks like this (see here):
name: CI
on: pull_request
jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: PR Labeler
uses: actions/labeler@2.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler-01.yml
job2:
runs-on: ubuntu-latest
steps:
- name: PR Labeler
uses: actions/labeler@2.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler-02.yml
I changed the following files:
- ./.github/workflows/ci.yml
- ./test.txt
- ./src/test.txt
However, finally only the GHA label was added successfully, the other three should also be added but not (see the example PR).
When using ‘.github/labeler-01.yml’, the actions always fails with the error (see job1):
##[error]TypeError: glob pattern string required
##[error]glob pattern string required
When using ‘.github/labeler-02.yml’, the action displays as success, but only the GHA label is added (see job2).
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
How to make the labeler.yml is unclear · Issue #18
In my opinion the README is clear. You need a .github/labeler.yml in the repository which describes relationship between touched files and labels attached...
Read more >An action for automatically labelling issues
Create a .github/labeler.yml file with a list of labels and regex to match to apply the label. The key is the name of...
Read more >Issues · actions/labeler
An action for automatically labelling pull requests - Issues ... Issue of the label configuration file ".github/labeler.yml" bug Something isn't working.
Read more >labeler/action.yml at main
An action for automatically labelling pull requests - labeler/action.yml at main ... label new pull requests based on the paths of files being...
Read more >Marketplace Actions Labeler
configuration-path, The path to the label configuration file .github/labeler.yml ; sync-labels, Whether or not to remove labels when matching files are reverted ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ok, I have found what is the culprit there. The meaning of
anyandallis poorly defined. The issue there is thatand
Have different meaning. The list in
anymean that any file in the PR must match all globs in the list. Withallit mean that all files in the PR must match all globs in the list. So to have the same behaviour withanyyou need to use:Hit this error just now:
It appears to have labeled two things correctly before barfing out.