From 8ac6bfeeb507a39742accbe9c86b94ed16f05a65 Mon Sep 17 00:00:00 2001 From: Noah Berman Date: Fri, 25 Mar 2022 10:13:36 +0000 Subject: [PATCH] Update run service and dockerfile --- Dockerfile | 2 +- README.md | 18 ++++++++++++------ lib/github_check_run_service.rb | 3 +-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7db0e6d..6e9582e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ruby:2.7.5-alpine -RUN gem install brakeman +RUN gem install brakeman -v 5.2.1 COPY lib /action/lib diff --git a/README.md b/README.md index 74edecc..639cfb6 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,19 @@ -## Brakeman github action +## Brakeman results parser github action Brakeman is a static analysis tool which checks Ruby on Rails applications for security vulnerabilities. -[See more](https://github.com/presidentbeef/brakeman) + +You can read more about Brakeman itself [here](https://github.com/presidentbeef/brakeman). + +This action helps make sure that brakeman results get accurately added to pull requests, in the event of a new issue. + +Currently we hardcode the brakeman version (5.2.1) to prevent the unintended consequences of pulling down the latest version +regardless of context. ### Usage ```yml - name: Brakeman - uses: cookpad/brakeman-linter-action@v1.0.1 + uses: cookpad/brakeman-linter-action@v1.0.2 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ``` @@ -22,7 +28,7 @@ Brakeman is a static analysis tool which checks Ruby on Rails applications for s run: | brakeman -f json > tmp/brakeman.json || exit 0 - name: Brakeman - uses: cookpad/brakeman-linter-action@v1.0.1 + uses: cookpad/brakeman-linter-action@v1.0.2 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} REPORT_PATH: tmp/brakeman.json @@ -32,7 +38,7 @@ Brakeman is a static analysis tool which checks Ruby on Rails applications for s ```yml - name: Brakeman - uses: cookpad/brakeman-linter-action@v1.0.1 + uses: cookpad/brakeman-linter-action@v1.0.2 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} PROJECT_PATH: my_rails_app @@ -51,7 +57,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Brakeman - uses: cookpad/brakeman-linter-action@v1.0.1 + uses: cookpad/brakeman-linter-action@v1.0.2 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ``` diff --git a/lib/github_check_run_service.rb b/lib/github_check_run_service.rb index 45ea2ab..9b18759 100644 --- a/lib/github_check_run_service.rb +++ b/lib/github_check_run_service.rb @@ -20,8 +20,7 @@ def run @annotations = @report_adapter.annotations(@report) @conclusion = @report_adapter.conslusion(@report) - pp '$' * 20 - pp '%' * 20 + puts @summary result = {} @annotations.each_slice(MAX_ANNOTATIONS_SIZE) do |annotations|