Path: blob/trunk/scripts/github-actions/check-format.sh
2867 views
#!/usr/bin/env bash12if [ ! -n "${GITHUB_WORKFLOW}" ]; then3echo "Do not run this script locally; use ./scripts/format.sh"4else5set -eufo pipefail6# We want to see what's going on7set -x89# The ruby version may have been set by the CI runner. Stash10# changes while we check to see if we need to reformat the11# code.12git config user.email "[email protected]"13git config user.name "CI Build"14git commit -am 'Temp commit to allow format to run cleanly'1516# Fail the build if the format script needs to be re-run17./scripts/format.sh18git diff --exit-code1920# Now we're made it out, reapply changes made by the build21# runner22git reset --soft HEAD^23fi242526