Skip to content
프로젝트

Cadeusept/dependency-validator

GitHub에서 보기

소개

지정한 라이브러리의 버전이 최신인지 확인합니다.

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
-3
in 7 days
+29
in 15 days
+354
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Dependency Validator

Keep CycloneDX dependencies aligned with the latest semantic Git tags.

Go 1.26.10 CycloneDX SBOM Generated with Syft Git tag versions Author: Cadeusept

Repository size Last commit Monthly commit activity Open pull requests Contributors
Go CI Go Reference Latest release Apache 2.0 license

Dependency Validator is a command-line utility that compares dependencies in a CycloneDX software bill of materials (SBOM) with the latest semantic-version tags in their source repositories.

It is useful in local development and CI when you want an explicit allowlist of dependencies that must stay on the newest tagged release.

How it works

  1. Dependency Validator finds an SBOM in the current directory.
  2. It reads library names and versions from a CycloneDX JSON document.
  3. For every repository in .dependency-validator-config.yaml, it finds the highest valid semantic-version Git tag.
  4. It exits with status 1 when at least one configured dependency is outdated.

Only dependencies listed in the configuration are checked. Components that are present in the SBOM but absent from the configuration are ignored.

Requirements

  • Git, used to read remote repository tags when validating dependencies.
  • A CycloneDX JSON SBOM, which can be generated with --gen-sbom using the embedded Syft library. Generation requires no external tools, configuration file, or network access.
  • Go 1.26.10 or newer when installing or building from source.

Installation

Install the latest tagged version with Go:

go install github.com/Cadeusept/dependency-validator@latest

Alternatively, use the installation script:

curl -sSfL https://raw.githubusercontent.com/Cadeusept/dependency-validator/master/install.sh | sh

Prebuilt archives are available on the GitHub Releases page.

To build the current source manually:

git clone https://github.com/Cadeusept/dependency-validator.git
cd dependency-validator
go build -o dependency-validator .

Configuration

For dependency version checks, create .dependency-validator-config.yaml in the project directory:

repos:
  - name: github.com/pedroalbanese/kuznechik
    repo_url: https://github.com/pedroalbanese/kuznechik

  - name: github.com/stretchr/testify
    repo_url: https://github.com/stretchr/testify
    token: ${GITHUB_TOKEN}

  - name: gitlab.com/private_username/private_repo
    repo_url: https://gitlab.com/private_username/private_repo
    token: ${GITLAB_TOKEN}

name must match the component name in the SBOM. repo_url must be a Git repository whose releases use valid semantic-version tags such as v1.2.3. token is optional, and environment variables in the configuration are expanded before it is parsed.

Do not commit access tokens. Pass them through an environment variable or your CI secret store.

Usage

Generate a CycloneDX JSON SBOM of the current directory:

dependency-validator --gen-sbom

This mode writes bom.json and exits without checking dependency versions. It replaces an existing bom.json after successful generation. Syft is built into the executable; a separate Syft installation is unnecessary. The scanner reads local manifests, lockfiles, and installed packages. Resolve dependencies before scanning when your ecosystem requires a lockfile or installed artifacts.

Run the validator from the directory containing the SBOM and configuration:

dependency-validator

Example output:

Found SBoM file: bom.json
Checking github.com/stretchr/testify...
Outdated: using v1.8.0, latest is v1.9.1

The following dependencies are outdated:
 - github.com/stretchr/testify (current: v1.8.0 → latest: v1.9.1)

GitHub Actions example

Keep .dependency-validator-config.yaml in your repository and add a workflow step like this:

name: Check dependencies

on:
  pull_request:
  push:
    branches: [master]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-go@v5
        with:
          go-version: '1.26.10'

      - name: Install Dependency Validator
        run: go install github.com/Cadeusept/dependency-validator@latest

      - name: Generate CycloneDX SBOM
        run: '"$(go env GOPATH)/bin/dependency-validator" --gen-sbom'

      - name: Check dependency versions
        run: "$(go env GOPATH)/bin/dependency-validator"

Scope and limitations

  • Only CycloneDX JSON input is parsed.
  • Upstream versions must be valid semantic-version Git tags.
  • The utility checks whether configured versions are current; it does not scan for vulnerabilities, license violations, dependency conflicts, or unused packages.
  • Repository access requires network connectivity and may require a token for private repositories or rate-limited environments.

Contributing

Bug reports and pull requests are welcome. Read the Contributing Guide before opening a pull request, and follow the Code of Conduct in all project spaces.

Security

Please report vulnerabilities privately according to the Security Policy. Do not disclose security-sensitive details in a public issue.

License

Dependency Validator is available under the Apache License 2.0. You may use, modify, and redistribute it under the license terms. Redistributions must preserve the applicable copyright and attribution notices in NOTICE.

관련 프로젝트 살펴보기

불러오는 중…