Skip to content

feat: add archived repo filter#42

Open
densfox wants to merge 1 commit intoadvanced-security:mainfrom
densfox:exclude_archived_rebased
Open

feat: add archived repo filter#42
densfox wants to merge 1 commit intoadvanced-security:mainfrom
densfox:exclude_archived_rebased

Conversation

@densfox
Copy link
Copy Markdown

@densfox densfox commented Mar 27, 2026

Changes


  • Added --exclude-archived CLI flag to exclude archived repositories before SBOM collection.
  • Wired excludeArchived through CollectorOptions into SbomCollector.
  • Applied filtering in org repo listing (GET /orgs/{org}/repos) so archived repos are skipped before
    queuing fetches.
  • Updated README argument reference for --exclude-archived.
  • Updated changelog entry for this feature (0.2.1).
  • Added test coverage for both paths:
    • flag off: archived + non-archived repos processed
    • flag on: archived repos excluded
  • Wired new test into npm test script.

Usage


From code:

    const collector = new SbomCollector({
    token: process.env.GITHUB_TOKEN,
    org: "my-org",
    syncSboms: true,
    excludeArchived: true
  });

From CLI:

  github-sbom-toolkit --org my-org --sync-sboms --exclude-archived --sbom-cache sboms --token
  $GITHUB_TOKEN

Default behavior is unchanged: if --exclude-archived is not set, all listed repositories are processed
as before.

Test uses local mock/monkey-patch pattern to keep production code surface unchanged in this PR.

Build and test pass; lint issue is pre-existing repo-wide ESLint v9 config mismatch (.eslintrc vs flat
config).

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.

1 participant