Skip to content

[BUG] _has_actionlint silently fails due to generator concatenation #373

Description

@donpenney

Bug Description

The _has_actionlint method in CodeSmellsAssessor has two detection paths: it first checks .pre-commit-config.yaml for actionlint, and if that's not found, it falls back to scanning .github/workflows/ files for actionlint references. The fallback path silently fails because it tries to concatenate two Path.glob() generators with + (line 886), which raises a TypeError since generators don't support the + operator. The bare except Exception: pass on line 892 swallows this error, so the function returns False without ever inspecting any workflow files. Repositories that configure actionlint in their workflows but not in pre-commit will never get credit for it.

To Reproduce

Steps to reproduce the behavior:

Run agentready assess on repo without .pre-commit-config.yaml (or with .pre-commit-config.yaml that doesn't have actionlint), but that has a .github/workflows/X.yml with actionlint.

Expected Behavior

Repo with workflow with actionlint, but no pre-commit, should pass this check

Actual Behavior

Repo with workflow with actionlint, but no pre-commit, fails the check and actually loses points, because the test runs due to presence of workflow file, but the file doesn't get scanned.

Environment

ghcr.io/ambient-code/agentready:latest in rootless podman

Possible Solution

Convert to lists before concatenating:

  for workflow_file in list(workflows_dir.glob("*.yml")) + list(workflows_dir.glob("*.yaml")):

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

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions