Skip to content

Commit 116350d

Browse files
committed
cleanup version check
1 parent e05b21f commit 116350d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

share/github-backup-utils/ghe-restore-actions

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,11 @@ restore-secret "Actions Launch token oauth cert" "actions-oauth-s2s-signing-cert
8787

8888
# Restore storage container prefix, but only if the `-c` option is used with ghe-restore to avoid staging instances using production bucket settings
8989
# This value will only be present in backups from versions >= 3.10 so needs to be wrapped in version checks.
90-
if [ -n "$GHE_RESTORE_SNAPSHOT_PATH" ]; then
91-
snapshot_version=$(cat "$GHE_RESTORE_SNAPSHOT_PATH/version")
92-
# shellcheck disable=SC2046 # Word splitting is required to populate the variables
93-
read -r snapshot_version_major snapshot_version_minor _ <<<$(ghe_parse_version "$snapshot_version")
94-
if [[ "$snapshot_version_major" -eq "3" && "$snapshot_version_minor" -ge "10" && $RESTORE_SETTINGS ]]; then
95-
restore-secret "Actions storage container prefix" "actions-storage-container-prefix" "secrets.actions.storage.container-prefix"
96-
fi
90+
snapshot_version=$(cat "$GHE_RESTORE_SNAPSHOT_PATH/version")
91+
# shellcheck disable=SC2046 # Word splitting is required to populate the variables
92+
read -r snapshot_version_major snapshot_version_minor _ <<<$(ghe_parse_version "$snapshot_version")
93+
if [[ $RESTORE_SETTINGS && "$snapshot_version_major" -eq "3" && "$snapshot_version_minor" -ge "10"]]; then
94+
restore-secret "Actions storage container prefix" "actions-storage-container-prefix" "secrets.actions.storage.container-prefix"
9795
fi
9896

9997
# Setup the database logins.

0 commit comments

Comments
 (0)