Skip to content

feat: add archived repo filter - #42

Closed
densfox wants to merge 1 commit into
advanced-security:mainfrom
densfox:exclude_archived_rebased
Closed

densfox wants to merge 1 commit into
advanced-security:mainfrom
densfox:exclude_archived_rebased

Conversation

@densfox

@densfox densfox commented Mar 27, 2026

Copy link
Copy Markdown

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).

@gubraun

gubraun commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Thanks a lot @densfox for this contribution, and sorry that this took a while 🙏

We've made some updates to the test infrastructure and lint config, and it was easier to reimplement the filter for archived repos in a new PR. You're credited in the PR description.

I'm closing this one as superseded by #67. Feel free to open a new PR on top of it if anything is missing!

@gubraun gubraun closed this Nov 6, 2026
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.

2 participants