File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -eufo pipefail
4
- # We want to see what's going on
5
- set -x
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
6
9
7
- # The ruby version may have been set by the CI runner. Stash
8
- # changes while we check to see if we need to reformat the
9
- # code.
10
- git config user.email
" [email protected] "
11
- git config user.name " CI Build"
12
- git commit -am ' Temp commit to allow format to run cleanly'
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'
13
16
14
- # Fail the build if the format script needs to be re-run
15
- ./scripts/format.sh
16
- git diff --exit-code
17
+ # Fail the build if the format script needs to be re-run
18
+ ./scripts/format.sh
19
+ git diff --exit-code
17
20
18
- # Now we're made it out, reapply changes made by the build
19
- # runner
20
- git reset --soft HEAD^
21
+ # Now we're made it out, reapply changes made by the build
22
+ # runner
23
+ git reset --soft HEAD^
24
+ fi
You can’t perform that action at this time.
0 commit comments