Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

found unexpected type for label 'xxxxxxxx' (should be array of config options) #710

Closed
2 of 5 tasks
danielmayor opened this issue Dec 4, 2023 · 4 comments
Closed
2 of 5 tasks
Labels
bug Something isn't working

Comments

@danielmayor
Copy link

danielmayor commented Dec 4, 2023

Description:
Somehow, today the labeler action started to fail. I didn't change any labeler config file or setup. I wonder if it's because of the new release (v5.0.0).

Execution output:

Run actions/labeler@master
  with:
    repo-token: ***
    configuration-path: .github/labeler.yml
    sync-labels: false
    dot: true
The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api
Error: Error: found unexpected type for label 'frontend' (should be array of config options)
Error: found unexpected type for label 'frontend' (should be array of config options)

.github/labeler.yml:

frontend:
  - shared/frontend/**/*

pdf:
  - shared/pdf/**/*

configurations:
  - .circleci/**/*
  - .github/**/*

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
The action runs automatically every time I create a PR. The labeler.yml hasn't any changes.

Expected behavior:
Action should run successfully.

Actual behavior:
I get this error: Error: Error: found unexpected type for label 'frontend' (should be array of config options)

@danielmayor danielmayor added bug Something isn't working needs triage labels Dec 4, 2023
@MaksimZhukov
Copy link
Contributor

Hello @danielmayor!
Thank you for creating the issue!

Yes, you are right, this failure is related to the new major release. You are using the main branch that contains the latest changes. According to the GitHub Actions documentation, it is not recommended to pin workflow to the main branch, because it can include breaking changes.

To mitigate the issue, please read the action documentation to find out how to adapt your configuration files for use with the new action version or use v4 tag that contains the previous version of configuration file structure.

@HorizonNet
Copy link

I would tend to say that the documentation is not correct. I'm running into the same problem mentioned in the description, having the following labeler configuration (please note that I tried different variations)

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

Which to me looks similar to the following snippet from the documentation mentioned above

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

The workflow definition is also similar to what I've seen in the documentation

---
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/[email protected]
        with:
          sync-labels: true

Am I missing something?

@MaksimZhukov
Copy link
Contributor

Hello @HorizonNet!
Could you please create a new issue?

@HorizonNet
Copy link

@MaksimZhukov Sure. Created #712.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants