Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ header: # `header` section is configurations for source codes license header.
- "**/assets/assets.gen.go"
- "docs/**.svg"
- "pkg/gitignore/dir.go"
- "pkg/deps/testdata/ruby/app/Gemfile.lock"
- "pkg/deps/testdata/ruby/library/Gemfile.lock"

comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`.

Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependency:
- Cargo.toml # If this is a rust project.
- package.json # If this is a npm project.
- go.mod # If this is a Go project.
- Gemfile.lock # If this is a Ruby project (Bundler). Ensure Gemfile.lock is committed.
```

#### Check License Headers
Expand Down Expand Up @@ -102,6 +103,40 @@ To check dependencies license in GitHub Actions, add a step in your GitHub workf
# flags: # optional: Extra flags appended to the command, for example, `--summary=path/to/template.tmpl`
```

<details>
<summary>Ruby projects (Bundler)</summary>

License-Eye can resolve Ruby dependencies and their licenses directly from Gemfile.lock.

Rules applied:
- If a .gemspec file exists in the same directory as Gemfile.lock, the project is treated as a library and development dependencies are ignored. Runtime dependencies (and their transitives) are included.
- If no .gemspec is present, the project is treated as an app and all dependencies from Gemfile.lock are considered (both runtime and development).

Requirements:
- Commit Gemfile.lock to version control so License-Eye can read the locked dependency graph.
- For libraries, ensure the .gemspec is present in the same directory as Gemfile.lock.

Minimal config snippet:

```yaml
dependency:
files:
- Gemfile.lock
```

GitHub Actions example:

```yaml
- name: Check Ruby dependencies' licenses
uses: apache/skywalking-eyes/dependency@main
with:
config: .licenserc.yaml
```

Note: License-Eye may query the RubyGems API to determine licenses when they are not specified in your configuration. Ensure the workflow has network access.

</details>

### Docker Image

For Bash, users can execute the following command,
Expand Down
1 change: 1 addition & 0 deletions pkg/deps/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var Resolvers = []Resolver{
new(MavenPomResolver),
new(JarResolver),
new(CargoTomlResolver),
new(GemfileLockResolver),
}

func Resolve(config *ConfigDeps, report *Report) error {
Expand Down
Loading