You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ruby dependency license scanning support via Gemfile.lock. (#205)
* Ruby dependency license scanning support via Gemfile.lock.
- Implements apache/skywalking#7744
- Library projects (with a *.gemspec in the same directory as Gemfile.lock) ignore development dependencies and include runtime dependencies and their transitives.
- App projects (no *.gemspec) include both runtime and development dependencies from Gemfile.lock.
- Will only work if Gemfile.lock is committed to version control, but this is the official recommendation of RubyGems:
- https://bundler.io/guides/faq.html#using-gemfiles-inside-gems
- License resolution honors user overrides/exclusions and may query the RubyGems API when necessary, with proper support for handling of various status codes.
- Documentation updated (README.md)
- Ruby setup and GitHub Actions example are in <details> tag to reduce noise
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ dependency:
38
38
- Cargo.toml # If this is a rust project.
39
39
- package.json # If this is a npm project.
40
40
- go.mod # If this is a Go project.
41
+
- Gemfile.lock # If this is a Ruby project (Bundler). Ensure Gemfile.lock is committed.
41
42
```
42
43
43
44
#### Check License Headers
@@ -102,6 +103,40 @@ To check dependencies license in GitHub Actions, add a step in your GitHub workf
102
103
# flags: # optional: Extra flags appended to the command, for example, `--summary=path/to/template.tmpl`
103
104
```
104
105
106
+
<details>
107
+
<summary>Ruby projects (Bundler)</summary>
108
+
109
+
License-Eye can resolve Ruby dependencies and their licenses directly from Gemfile.lock.
110
+
111
+
Rules applied:
112
+
- 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.
113
+
- If no .gemspec is present, the project is treated as an app and all dependencies from Gemfile.lock are considered (both runtime and development).
114
+
115
+
Requirements:
116
+
- Commit Gemfile.lock to version control so License-Eye can read the locked dependency graph.
117
+
- For libraries, ensure the .gemspec is present in the same directory as Gemfile.lock.
118
+
119
+
Minimal config snippet:
120
+
121
+
```yaml
122
+
dependency:
123
+
files:
124
+
- Gemfile.lock
125
+
```
126
+
127
+
GitHub Actions example:
128
+
129
+
```yaml
130
+
- name: Check Ruby dependencies' licenses
131
+
uses: apache/skywalking-eyes/dependency@main
132
+
with:
133
+
config: .licenserc.yaml
134
+
```
135
+
136
+
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.
137
+
138
+
</details>
139
+
105
140
### Docker Image
106
141
107
142
For Bash, users can execute the following command,
0 commit comments