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

Error: found unexpected type for label '<label>' (should be array of config options) #818

Open
2 of 5 tasks
coilysiren opened this issue Nov 7, 2024 · 5 comments
Open
2 of 5 tasks
Assignees
Labels
bug Something isn't working

Comments

@coilysiren
Copy link

Description:

I suspect that I'm just getting the labeler syntax wrong, but unfortunately I can't get it to work. Some assistance would be appreciated.

I'm getting the same error message as #716

Action v5:

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

.github/workflows/labeler.yml

name: Pull Request Labeler

on:
  pull_request_target:
    types: [opened, reopened, synchronize]

jobs:
  label:
    name: Labeler
    permissions:
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4 # Uploads repository content to the runner
        with:
          sparse-checkout: |
            .github
      - uses: actions/labeler@v5

.github/labeler.yml

- any:
    - changed-files:
        - javascript: ["**/*.js", "**/*.jsx"]
        - typescript: ["**/*.ts", "**/*.tsx"]
        - python: ["**/*.py"]
        - terraform: ["**/*.tf"]
        - shell: ["**/*.sh"]
        - api: ["api/**/*"]
        - frontend: ["frontend/**/*"]
        - analytics: ["analytics/**/*"]
        - ci/cd: [".github/workflows/**/*", "bin/**/*", "**/*/Makefile"]
        - documentation: ["documentation/**/*", "**/*.md"]
        - infra: ["infra/**/*"]
        - database: ["api/src/db/**/*"]
        - openapi: ["api/openapi.generated.yaml"]
        - storybook: ["frontend/stories/**/*", "frontend/.storybook/**/*"]

HHS/simpler-grants-gov#2774

Expected behavior:

Labels are added. Or at least, CI doesn't fail.

Actual behavior:

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

@coilysiren coilysiren added bug Something isn't working needs triage labels Nov 7, 2024
@mahabaleshwars
Copy link

Hello @coilysiren,
Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.

@coilysiren
Copy link
Author

coilysiren commented Nov 8, 2024

It looks like this might be the issue?

#712 (comment)

Unfortunately I was expecting the labeler run inside of a PR branch to actually use the configuration from that PR branch! Probably a naive assumption on my part.

@coilysiren
Copy link
Author

After merging I'm getting a new error:

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

@suyashgaonkar
Copy link
Contributor

suyashgaonkar commented Dec 18, 2024

Hi @coilysiren , We investigated the issue with the provided information and it looks like the issue lies with the labeler.yml configuration file. Configuring the configuration file in the similar way to given code snippet below should resolve the issue.

Javascript:
- any:
   - changed-files:
      - any-glob-to-any-file: ["**/*.js", "**/*.jsx"]
Typescript:
- any:
  - changed-files:
    - any-glob-to-any-file: ["**/*.ts", "**/*.tsx"]
Python:
- any:
  - changed-files:
    - any-glob-to-any-file: ["**/*.py"]

Check the attached screenshots for result.

image

image

Refer to the following url for the workflow run

@suyashgaonkar
Copy link
Contributor

Hi @coilysiren , Please let us know if we can close this issue or do you have queries or need any assistance on this

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