question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue of the label configuration file ".github/labeler.yml"

See original GitHub issue

Associated 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:open
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
haulethcommented, Sep 27, 2020

Ok, I have found what is the culprit there. The meaning of any and all is poorly defined. The issue there is that

- any: ['./*', './src/*']

and

- ./*
- ./src/*

Have different meaning. The list in any mean that any file in the PR must match all globs in the list. With all it mean that all files in the PR must match all globs in the list. So to have the same behaviour with any you need to use:

- any: ['./*']
- any: ['./src/*']
0reactions
smokhovcommented, Jan 14, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found