Skip to content

Fix Auto Label PRs: migrate labeler config to actions/labeler@v5 schema#7

Merged
jaseel0 merged 3 commits intomainfrom
copilot/fix-auto-label-prs-job
Feb 20, 2026
Merged

Fix Auto Label PRs: migrate labeler config to actions/labeler@v5 schema#7
jaseel0 merged 3 commits intomainfrom
copilot/fix-auto-label-prs-job

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

actions/labeler@v5 requires each label key to map to an array of config objects; the old config used the v4 flat-glob schema, causing a fatal parse error on every PR.

Changes

  • .github/labeler.yml — Rewrote all label rules from bare glob arrays to the v5 changed-files / any-glob-to-any-file structure, preserving identical match intent
  • .github/workflows/labeler.yml — Added the missing workflow file that invokes actions/labeler@v5 with sync-labels: false and dot: true

Schema change

# Before (v4 — caused: "found unexpected type for label 'first-contribution'")
first-contribution:
  - Contributors.md

# After (v5)
first-contribution:
  - changed-files:
      - any-glob-to-any-file:
          - "Contributors.md"
Original prompt

Fix failing GitHub Actions job Auto Label PRs. Job logs show labeler action error:

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

The workflow fetches .github/labeler.yml and expects each label key to map to an array of config option objects (the schema used by actions/labeler@v5), but the current file maps labels directly to an array of globs.

References

Current .github/labeler.yml

# Auto-label rules based on files changed in a PR

first-contribution:
  - Contributors.md

documentation:
  - "*.md"
  - "docs/**"

github-config:
  - ".github/**"

Task

  1. Update .github/labeler.yml to the correct v5 schema so each label is an array of rule objects, e.g. using changed-files + any-glob-to-any-file.
  2. Ensure patterns preserve current intent:
    • first-contribution when Contributors.md changes
    • documentation when any *.md changes or anything under docs/** changes
    • github-config when anything under .github/** changes
  3. Keep YAML valid and minimal.
  4. Verify the workflow will parse the file without the “unexpected type” error.

Expected updated structure (example)

first-contribution:
  - changed-files:
      - any-glob-to-any-file:
          - "Contributors.md"

Apply same pattern to other labels.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: naheel0 <191262736+naheel0@users.noreply.github.com>
@jaseel0 jaseel0 requested review from jaseel0 and naheel0 February 20, 2026 09:02
Copilot AI changed the title [WIP] Fix GitHub Actions job Auto Label PRs Fix Auto Label PRs: migrate labeler config to actions/labeler@v5 schema Feb 20, 2026
@jaseel0
Copy link
Contributor

jaseel0 commented Feb 20, 2026

@copilot resolve the conflicts

Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot resolve the conflicts

The conflict exists because PR #6 was merged into main after this branch was created — it added .github/labeler.yml and .github/workflows/labeler.yml with the old v4 schema, which conflicts with the v5 fixes in this branch.

I'm unable to pull from GitHub to resolve the merge conflict in this environment. Could you please merge main into this branch (or rebase onto main) and keep the v5 schema content from this branch for both files? The correct resolved content should be:

.github/labeler.yml (keep this branch's version):

# Auto-label rules based on files changed in a PR

first-contribution:
  - changed-files:
      - any-glob-to-any-file:
          - "Contributors.md"

documentation:
  - changed-files:
      - any-glob-to-any-file:
          - "*.md"
          - "docs/**"

github-config:
  - changed-files:
      - any-glob-to-any-file:
          - ".github/**"

.github/workflows/labeler.yml (keep this branch's version, which adds sync-labels: false and dot: true).

Copilot AI requested a review from jaseel0 February 20, 2026 09:06
@jaseel0
Copy link
Contributor

jaseel0 commented Feb 20, 2026

@copilot which one current or incoming?

Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot which one current or incoming?

Keep the incoming changes (this branch's version) for both files. That's the correct v5 schema fix. Discard the "current" (main) versions which have the old v4 flat-glob schema that causes the error.

@jaseel0 jaseel0 marked this pull request as ready for review February 20, 2026 09:12
@jaseel0 jaseel0 merged commit d8aa8ec into main Feb 20, 2026
2 checks passed
@jaseel0 jaseel0 deleted the copilot/fix-auto-label-prs-job branch February 20, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants