Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/scripts/github-actions/check-format.sh
2867 views
1
#!/usr/bin/env bash
2
3
if [ ! -n "${GITHUB_WORKFLOW}" ]; then
4
echo "Do not run this script locally; use ./scripts/format.sh"
5
else
6
set -eufo pipefail
7
# We want to see what's going on
8
set -x
9
10
# The ruby version may have been set by the CI runner. Stash
11
# changes while we check to see if we need to reformat the
12
# code.
13
git config user.email "[email protected]"
14
git config user.name "CI Build"
15
git commit -am 'Temp commit to allow format to run cleanly'
16
17
# Fail the build if the format script needs to be re-run
18
./scripts/format.sh
19
git diff --exit-code
20
21
# Now we're made it out, reapply changes made by the build
22
# runner
23
git reset --soft HEAD^
24
fi
25
26