Skip to content

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

Description

@BrightRan

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions