actions / labeler

An action for automatically labelling pull requests
MIT License
1.99k stars 419 forks source link

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

Open coilysiren opened 2 weeks ago

coilysiren commented 2 weeks ago

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 https://github.com/actions/labeler/issues/716

Action v5:

Platform:

Runner type:

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/**/*"]

https://github.com/HHS/simpler-grants-gov/pull/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)

mahabaleshwars commented 2 weeks ago

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

coilysiren commented 2 weeks ago

It looks like this might be the issue?

https://github.com/actions/labeler/issues/712#issuecomment-2454544085

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 commented 2 weeks ago

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)