File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 47
47
env :
48
48
GITHUB_EVENT_NAME : ${{ github.event_name }}
49
49
run : |
50
+ if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
51
+ if git status -s -b | grep -q '^##.*(no branch)$'; then
52
+ echo 2>&1 "Error: Git is in detached HEAD state"
53
+ exit 1
54
+ fi
55
+ fi
56
+
50
57
if [ -n "$(git status --porcelain 'nix/')" ]; then
51
58
if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then
52
59
echo 2>&1 "Error: found modified files"
@@ -103,6 +110,13 @@ jobs:
103
110
env :
104
111
GITHUB_EVENT_NAME : ${{ github.event_name }}
105
112
run : |
113
+ if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
114
+ if git status -s -b | grep -q '^##.*(no branch)$'; then
115
+ echo 2>&1 "Error: Git is in detached HEAD state"
116
+ exit 1
117
+ fi
118
+ fi
119
+
106
120
if [ -n "$(git status --porcelain '*.hs')" ]; then
107
121
if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then
108
122
echo 2>&1 "Error: found modified files"
You can’t perform that action at this time.
0 commit comments