Skip to content

Commit 2d3300d

Browse files
authored
Merge pull request #836 from github/rdelany/actions-start-force
Fix compat issue with ghe-actions-start during maintenance mode
2 parents 8ca50df + 02dc2da commit 2d3300d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bin/ghe-restore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,14 @@ cleanup () {
9393

9494
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.actions.enabled'; then
9595
echo "Restarting Actions after restore ..."
96-
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-actions-start' 1>&3
96+
# In GHES 3.3+, ghe-actions-start no longer has a -f (force) flag. In GHES 3.2 and below, we must provide the
97+
# force flag to make sure it can start in maintenance mode. Use it conditionally based on whether it exists
98+
# in the --help output
99+
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-actions-start --help' | grep -q force ; then
100+
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-actions-start -f' 1>&3
101+
else
102+
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-actions-start' 1>&3
103+
fi
97104
fi
98105

99106
# Cleanup SSH multiplexing

0 commit comments

Comments
 (0)