prysm-pulse/.github/actions/gofmt/entrypoint.sh
Victor Farazdagi 53b0c0f7ab
Adds gofmt checker action to GitHub workflow (#6132)
* adds gofmt checker action to GitHub workflow
* gofmt applied
2020-06-04 16:16:45 +00:00

16 lines
300 B
Bash
Executable File

#!/bin/sh -l
set -e
cd $GITHUB_WORKSPACE
# Check if any files are not formatted.
nonformatted="$(gofmt -l $1 2>&1)"
# Return if `go fmt` passes.
[ -z "$nonformatted" ] && exit 0
# Notify of issues with formatting.
echo "Following files need to be properly formatted:"
echo "$nonformatted"
exit 1