Skip to content

fix(action): make scan-path-not-found error event-aware and self-contained (#11)#47

Merged
Metbcy merged 1 commit into
mainfrom
fix/11-scan-path-error
May 17, 2026
Merged

fix(action): make scan-path-not-found error event-aware and self-contained (#11)#47
Metbcy merged 1 commit into
mainfrom
fix/11-scan-path-error

Conversation

@Metbcy
Copy link
Copy Markdown
Owner

@Metbcy Metbcy commented May 17, 2026

Closes #11.

Problem

When the action fails with scan path not found: <dir>, the existing error skims over two friction points:

  1. On pull_request events, GITHUB_WORKSPACE points at the merge-ref checkout, so a missing dir often means the PR doesn't actually touch that path — different cause than push/workflow_dispatch.
  2. The monorepo recipe is only available via a docs link, which is friction during a red CI run.

Fix

  • Error message is now event-aware: tailored hint for pull_request vs push/workflow_dispatch.
  • Inline monorepo recipe (matrix snippet) printed directly in the action log so you don't have to leave the failing run to fix it.
  • Restates the no-silent-fallback contract so the failure mode stays explicit.

Files

  • entrypoint.sh — event-aware branching + inline recipe
  • docs/src/github-action.md — new troubleshooting row for scan path not found: <dir>

Verification

  • bash -n entrypoint.sh
  • Failure path remains loud — no silent fallback to repo root.

…ained

Closes #11.

The existing error message lists likely causes and links to the
monorepo docs, but skims over two friction points:

- On non-PR events ('push', 'workflow_dispatch', 'schedule') the
  default 'before-ref' is the parent commit, which frequently
  predates a freshly-added monorepo subdirectory. Users currently
  have to infer this from the 'before-ref' parenthetical; now the
  message says it outright with the event name.
- The monorepo matrix recipe was a click away. For a build that
  failed mid-job, inlining the four-line snippet is faster than
  asking the user to leave the log.

Also restates that bomdrift will not silently fall back to the
repo root — DoD line 'keep the failure loud' — so a reader who
only skims the bottom of the error still knows not to chase a
'maybe it'll just work' fix.

Docs: adds a row to the troubleshooting table in
docs/src/github-action.md mirroring the new shape so the
symptom is greppable.

'bash -n entrypoint.sh' passes.
@github-actions
Copy link
Copy Markdown

SBOM diff

No dependency changes.

@github-actions
Copy link
Copy Markdown

Coverage report

Line coverage: 84.1% (9381 / 11149 lines)

Full lcov report available as workflow artifact coverage-lcov: download from this run.

v0.9.8 introduces this report; --fail-under-lines will be added once coverage is visible across 2–3 releases.

@Metbcy Metbcy merged commit 95df0a5 into main May 17, 2026
11 checks passed
@Metbcy Metbcy deleted the fix/11-scan-path-error branch May 17, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the error message for missing action scan paths

1 participant