Skip to content

Commit

Permalink
Use token authentication properly
Browse files Browse the repository at this point in the history
  • Loading branch information
bermannoah committed Mar 28, 2022
1 parent 8ac6bfe commit 421e611
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v1.0.3

- Use token authentication correctly

## v1.0.2

- More useful verbose output

## v1.0.1

- Modify and update for Cookpad
Expand Down
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].2
uses: cookpad/[email protected].3
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].2
uses: cookpad/[email protected].3
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].2
uses: cookpad/[email protected].3
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].2
uses: cookpad/[email protected].3
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
```
Expand Down
3 changes: 1 addition & 2 deletions lib/github_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ def post(url, body = {})
def headers
@headers ||= {
"Content-Type": 'application/json',
"Accept": 'application/vnd.github.antiope-preview+json',
"Authorization": "Bearer #{@github_token}",
"Authorization": "token #{@github_token}",
"User-Agent": @user_agent
}
end
Expand Down

0 comments on commit 421e611

Please sign in to comment.