Skip to content

Commit

Permalink
make revive config optional
Browse files Browse the repository at this point in the history
  • Loading branch information
morphy2k committed Aug 31, 2019
1 parent 2000673 commit 0c550e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This Action runs [Revive](https://github.com/mgechev/revive) on your [Go](https:
- name: Run Revive Action
uses: morphy2k/revive-action@v1
with:
# Path to your Revive config within the repo (default: revive.toml)
# Path to your Revive config within the repo (optional)
config: revive/config.toml
env:
# GitHub token needed if you want to use annotations
Expand Down
1 change: 0 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ inputs:
config:
description: 'Path of the Revive config file'
required: false
default: 'revive.toml'
runs:
using: 'docker'
image: 'Dockerfile'
8 changes: 6 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

set -e

CONFIG=""

if [ ! -z "${INPUT_CONFIG}" ]; then CONFIG="-config=$INPUT_CONFIG"; fi

if [ ! -z "${GITHUB_TOKEN}" ];
then
sh -c "cd $GITHUB_WORKSPACE && revive -config $INPUT_CONFIG -formatter ndjson ./... | revive-action"
sh -c "cd $GITHUB_WORKSPACE && revive $CONFIG -formatter ndjson ./... | revive-action"
else
sh -c "cd $GITHUB_WORKSPACE && revive -config $INPUT_CONFIG -formatter friendly ./..."
sh -c "cd $GITHUB_WORKSPACE && revive $CONFIG -formatter friendly ./..."
fi

0 comments on commit 0c550e5

Please sign in to comment.