-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a7e654
commit 82be558
Showing
13 changed files
with
155 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { IntrospectFn } from "../../../types.ts"; | ||
import { hasRubyDependencyAny } from "./dependencies.ts"; | ||
|
||
const webApps = new Set([ | ||
"rails", | ||
"rack", | ||
"sinatra", | ||
"hanami", | ||
"padrino", | ||
"roda", | ||
]); | ||
|
||
export const introspect: IntrospectFn<string | null> = async (context) => { | ||
if (await hasRubyDependencyAny(context, webApps)) { | ||
return "webApp"; | ||
} | ||
return null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: SAST Ruby | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.rb" | ||
jobs: | ||
semgrep: | ||
name: Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: returntocorp/semgrep-action@v1 | ||
with: | ||
config: >- | ||
<% if (it.type === "webApp") { -%> | ||
p/owasp-top-ten | ||
<% } else {-%> | ||
p/ci | ||
<% } -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/fixtures/ruby/rubocop-lint/expected/.github/workflows/pipelinit.ruby.sast.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
name: SAST Ruby | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.rb" | ||
jobs: | ||
semgrep: | ||
name: Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: returntocorp/semgrep-action@v1 | ||
with: | ||
config: >- | ||
p/ci |
20 changes: 20 additions & 0 deletions
20
tests/fixtures/ruby/sinatra/expected/.github/workflows/pipelinit.ruby.format.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
name: Format Ruby | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.rb" | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.0.2" | ||
bundler-cache: true | ||
- run: gem install | ||
- run: gem install rubocop | ||
- run: bundle exec rubocop --format . |
20 changes: 20 additions & 0 deletions
20
tests/fixtures/ruby/sinatra/expected/.github/workflows/pipelinit.ruby.lint.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
name: Lint Ruby | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.rb" | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.0.2" | ||
bundler-cache: true | ||
- run: gem install | ||
- run: gem install rubocop | ||
- run: bundle exec rubocop --lint . |
17 changes: 17 additions & 0 deletions
17
tests/fixtures/ruby/sinatra/expected/.github/workflows/pipelinit.ruby.sast.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
name: SAST Ruby | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.rb" | ||
jobs: | ||
semgrep: | ||
name: Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: returntocorp/semgrep-action@v1 | ||
with: | ||
config: >- | ||
p/owasp-top-ten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
platforms = ["github"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source 'https://rubygems.org' | ||
gem 'sinatra', :github => 'sinatra/sinatra' | ||
|
||
# other dependencies | ||
gem 'haml' # for instance, if you use haml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# myapp.rb | ||
require 'sinatra' | ||
|
||
get '/' do | ||
'Hello world!' | ||
end |