From 421e61118ec885b46f83d30f262cb67e0767f8c4 Mon Sep 17 00:00:00 2001 From: Noah Berman Date: Mon, 28 Mar 2022 15:31:23 +0100 Subject: [PATCH] Use token authentication properly --- CHANGELOG.md | 8 ++++++++ README.md | 8 ++++---- lib/github_client.rb | 3 +-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 211f740..bac42d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 639cfb6..3215fcd 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ regardless of context. ```yml - name: Brakeman - uses: cookpad/brakeman-linter-action@v1.0.2 + uses: cookpad/brakeman-linter-action@v1.0.3 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ``` @@ -28,7 +28,7 @@ regardless of context. run: | brakeman -f json > tmp/brakeman.json || exit 0 - name: Brakeman - uses: cookpad/brakeman-linter-action@v1.0.2 + uses: cookpad/brakeman-linter-action@v1.0.3 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} REPORT_PATH: tmp/brakeman.json @@ -38,7 +38,7 @@ regardless of context. ```yml - name: Brakeman - uses: cookpad/brakeman-linter-action@v1.0.2 + uses: cookpad/brakeman-linter-action@v1.0.3 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} PROJECT_PATH: my_rails_app @@ -57,7 +57,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Brakeman - uses: cookpad/brakeman-linter-action@v1.0.2 + uses: cookpad/brakeman-linter-action@v1.0.3 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ``` diff --git a/lib/github_client.rb b/lib/github_client.rb index 3744ef2..40b47c6 100644 --- a/lib/github_client.rb +++ b/lib/github_client.rb @@ -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