labeler: Error: found unexpected type for label 'xxx' (should be array of config options)

Description: After upgrading to v5.0.0 and changing the labeler configuration file matching to what is outlined in the documentation, I’m receiving the following error as soon as the action starts

Run actions/labeler@v5.0.0
The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api
Error: Error: found unexpected type for label 'terraform' (should be array of config options)
Error: found unexpected type for label 'terraform' (should be array of config options)

Action version: 5.0.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
After upgrading to 5.0.0 changed the labeler configuration to

terraform:
  - changed-files:
    - any-glob-to-any-file: terraform/**

which to me looks similar to the example from the documentation

Documentation:
- changed-files:
  - any-glob-to-any-file: docs/*

The workflow is defined as follows and used to work previously

---
name: Pull Request Labeler

on:
  pull_request_target:

jobs:
  triage:
    name: Label triage

    permissions:
      contents: read
      pull-requests: write

    runs-on: ubuntu-22.04

    steps:
      - uses: actions/labeler@v5.0.0
        with:
          sync-labels: true

Expected behavior: The action should run successfully.

Actual behavior: The action is failing with the error provided above.

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Reactions: 15
  • Comments: 26 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I missed the checkout action (https://github.com/scikit-rf/scikit-rf/blob/06190acd59d7be77e7907b45456ffecba66dfd1d/.github/workflows/PR_labeler.yml#L9) in our configuration yml file before, that’s why the old labeler.yml file was used all the time.

This is visible through this line in the logs.

The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api

So I ended up deleting the whole workflow (https://github.com/scikit-rf/scikit-rf/pull/985), labeler still failed as there was no checkout task. After merging to master I re enabled the PR labeler from scratch (https://github.com/scikit-rf/scikit-rf/pull/986).

Oh, wow. I didn’t see that. That’s a significant change. Noted. 👍🏻