Skip to content

Commit

Permalink
Add correct github API header and update test
Browse files Browse the repository at this point in the history
  • Loading branch information
bermannoah committed Mar 28, 2022
1 parent d42e326 commit 4a71afc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ regardless of context.

```yml
- name: Brakeman
uses: cookpad/[email protected].3
uses: cookpad/[email protected].4
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
```
Expand All @@ -28,7 +28,7 @@ regardless of context.
run: |
brakeman -f json > tmp/brakeman.json || exit 0
- name: Brakeman
uses: cookpad/[email protected].3
uses: cookpad/[email protected].4
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
REPORT_PATH: tmp/brakeman.json
Expand All @@ -38,7 +38,7 @@ regardless of context.
```yml
- name: Brakeman
uses: cookpad/[email protected].3
uses: cookpad/[email protected].4
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PROJECT_PATH: my_rails_app
Expand All @@ -57,7 +57,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Brakeman
uses: cookpad/[email protected].3
uses: cookpad/[email protected].4
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
```
Expand Down
4 changes: 1 addition & 3 deletions lib/github_check_run_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def run

result = {}
@annotations.each_slice(MAX_ANNOTATIONS_SIZE) do |annotation|
post_result = client_patch(id, annotation)
result.merge(post_result)
puts post_result
result.merge(client_patch(id, annotation))
end
result
end
Expand Down
3 changes: 2 additions & 1 deletion lib/github_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def headers
@headers ||= {
"Content-Type": 'application/json',
"Authorization": "token #{@github_token}",
"User-Agent": @user_agent
"User-Agent": @user_agent,
"Accept": 'application/vnd.github.v3+json'
}
end

Expand Down

0 comments on commit 4a71afc

Please sign in to comment.