Skip to content

Commit

Permalink
Merge pull request #1880 from GiganticMinecraft/fix/ci
Browse files Browse the repository at this point in the history
GITHUB_TOKENをinputsから受け取るようにする
  • Loading branch information
Lucky3028 authored Feb 9, 2023
2 parents ad2c087 + ee5b103 commit 34cf6f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/actions/run-reviewdog/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ inputs:
description: The reviewdog's name.
required: true
default: reviewdog
github-token:
description: The GitHub Actions's token
required: true
runs:
using: composite
steps:
Expand All @@ -15,17 +18,17 @@ runs:
REVIEWDOG_VERSION="0.14.1"
FILE_NAME="reviewdog_${REVIEWDOG_VERSION}_Linux_x86_64.tar.gz"
wget -q https://github.com/reviewdog/reviewdog/releases/download/v${REVIEWDOG_VERSION}/${FILE_NAME}
tar -zxvf ${FILE_NAME}
rm -rf ${FILE_NAME}
tar -zxvf "${FILE_NAME}"
rm -rf "${FILE_NAME}"
chmod +x ./reviewdog
sudo mv reviewdog /usr/local/bin
fi
reviewdog -version
shell: bash
- name: Run reviewdog
run: |
export REVIEWDOG_GITHUB_API_TOKEN="${GITHUB_TOKEN}"
TMPFILE=$(mktemp)
REVIEWDOG_GITHUB_API_TOKEN="${GITHUB_TOKEN}"
TMPFILE="$(mktemp)"
git diff > "${TMPFILE}"
reviewdog \
-name="${REVIEWDOG_NAME}" \
Expand All @@ -37,5 +40,5 @@ runs:
-level="warning" <"${TMPFILE}"
env:
REVIEWDOG_NAME: ${{ inputs.reviewdog-name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
shell: bash
2 changes: 2 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ jobs:
if: ${{ (github.event_name == 'pull_request') && failure() }}
with:
reviewdog-name: scalafmt
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check lint with Scalafix on push
if: ${{ (github.event_name == 'push')}}
Expand All @@ -121,6 +122,7 @@ jobs:
if: ${{ (github.event_name == 'pull_request') && failure() }}
with:
reviewdog-name: scalafix
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Test and build artifact
run: sbt assembly
Expand Down

0 comments on commit 34cf6f7

Please sign in to comment.