Skip to content

Clarify path semantics for abom scan #11

Description

@sschuberth

I'm having a bit of trouble understanding how to specify a path for abom scan. Help says:

Usage:
  abom scan [path or github.com/owner/repo] [flags]

So if I'm in the root of my cloned Git project, I would expect abom scan .github/workflows to work, but this gives

Error: parsing workflows: reading workflows directory: open .github/workflows/.github/workflows: no such file or directory

So I though, ok, the path is always supposed to be relative to .github/workflows, and I tried abom scan .github/workflows/test, but that gives

Error: target must be a local directory or github.com/owner/repo: test

although the .github/workflows/test directory exists.

As a user, what I would expect is for a path passed as an argument:

  • if the path is absolute, use it as-is.
  • if the path is relative, resolve it against the current working directory (not the .github/workflows directory).
  • if the path points to a directory, scan all workflows in that directory (non-recursively).
  • if the path points to a file, scan only the workflow in that file.
  • if no path is given, default to using a relative path of ".github/workflows".

I'm also not a big fan of the special "github.com/owner/repo" syntax, as that present scanning local paths with than name. A way to solve that would be to require a --url option for that mode.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions