-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] do not locally execute a script intended for ci
- Loading branch information
1 parent
e7c60f5
commit 7397877
Showing
1 changed file
with
19 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eufo pipefail | ||
# We want to see what's going on | ||
set -x | ||
if [ ! -n "${GITHUB_WORKFLOW}" ]; then | ||
echo "Do not run this script locally; use ./scripts/format.sh" | ||
else | ||
set -eufo pipefail | ||
# We want to see what's going on | ||
set -x | ||
|
||
# The ruby version may have been set by the CI runner. Stash | ||
# changes while we check to see if we need to reformat the | ||
# code. | ||
git config user.email "[email protected]" | ||
git config user.name "CI Build" | ||
git commit -am 'Temp commit to allow format to run cleanly' | ||
# The ruby version may have been set by the CI runner. Stash | ||
# changes while we check to see if we need to reformat the | ||
# code. | ||
git config user.email "[email protected]" | ||
git config user.name "CI Build" | ||
git commit -am 'Temp commit to allow format to run cleanly' | ||
|
||
# Fail the build if the format script needs to be re-run | ||
./scripts/format.sh | ||
git diff --exit-code | ||
# Fail the build if the format script needs to be re-run | ||
./scripts/format.sh | ||
git diff --exit-code | ||
|
||
# Now we're made it out, reapply changes made by the build | ||
# runner | ||
git reset --soft HEAD^ | ||
# Now we're made it out, reapply changes made by the build | ||
# runner | ||
git reset --soft HEAD^ | ||
fi |