Skip to content

Labeler workflow fails with ".github/labeler.yml not found" on pull_request_target #143

Description

@rinit18

Summary

The label GitHub Action is failing on PRs with:

  • The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api
  • Warning: The config file was not found at .github/labeler.yml
  • Error: HttpError: Not Found

This causes PR checks to fail for contributors.

Workflow Affected

  • File: .github/workflows/label.yml
  • Action: actions/labeler@v5.0.0
  • Trigger: pull_request_target

Current Behavior

label job fails even when PR changes are valid.

Expected Behavior

label job should:

  1. Resolve .github/labeler.yml reliably from base branch context, or
  2. Skip with warning (not fail PR) if config is missing.

Impact

  • Blocks/interrupts PR flow.
  • Adds noisy CI failures unrelated to code quality.
  • Affects contributor experience across repo PRs.

Proposed Fix

Update .github/workflows/label.yml to:

  1. Checkout base branch first (actions/checkout@v4 with github.event.pull_request.base.ref)
  2. Verify .github/labeler.yml exists
  3. Run actions/labeler@v5 with explicit:
    • repo-token: ${{ secrets.GITHUB_TOKEN }}
    • configuration-path: .github/labeler.yml
  4. If config missing, warn + skip label step instead of failing workflow

Also ensure .github/labeler.yml exists on the repository base/default branch.

Acceptance Criteria

  • label workflow no longer fails with config 404.
  • PRs are not blocked by labeler config lookup issues.
  • Labels are applied when .github/labeler.yml is present.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions