Skip to content

Commit

Permalink
Added more notes
Browse files Browse the repository at this point in the history
  • Loading branch information
revans committed Jun 26, 2020
1 parent 23921ff commit 77be13a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ set -e


# Default Vars
DEFAULT_RULES_LOCATION='/action/lib/.automation'
DEFAULT_RULES_LOCATION="/action/lib/.automation"
LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}"

# Linter Vars
ERB_LINTER_FILE_NAME=".erb-lint.yml"
ERB_LINTER_RULES="$DEFAULT_RULES_LOCATION/$ERB_LINTER_FILE_NAME"
LINTER_PATH="$GITHUB_WORKSPACE/$LINTER_RULES_PATH/$ERB_LINTER_FILE_NAME"
FILE_NAME=".erb-lint.yml"
FILE_LOCATION="$DEFAULT_RULES_LOCATION/$FILE_NAME"

if [ -f "$LINTER_PATH" ]; then
echo "Checking for Rules File..."

if [ -f "$GITHUB_WORKSPACE/$LINTER_RULES_PATH/$FILE_NAME" ]; then
echo "----------------------------------------------"
echo "User provided file:[$ERB_LINTER_FILE_NAME], setting rules file..."
echo "User provided file:[$FILE_NAME], setting rules file..."
####################################
# Copy users into default location #
####################################
cp "$LINTER_PATH" "$ERB_LINTER_RULES" 2>&1
cp "$GITHUB_WORKSPACE/$LINTER_RULES_PATH/$FILE_NAME" "$FILE_LOCATION" 2>&1
else
echo " -> Codebase does NOT have file:[$LINTER_RULES_PATH/$ERB_LINTER_FILE_NAME], using Default rules at:[$ERB_LINTER_RULES]"
echo " -> Codebase does NOT have file:[$LINTER_RULES_PATH/$FILE_NAME], using Default rules at:[$FILE_LOCATION]"
fi

sh -c "gem install erb_lint"

command="erblint --config ${ERB_LINTER_RULES} --lint-all"
command="erblint --config ${FILE_LOCATION} --lint-all"
cd "$GITHUB_WORKSPACE"
sh -c $command

0 comments on commit 77be13a

Please sign in to comment.