Skip to content

Commit 965766a

Browse files
committed
feat: retry
1 parent a600407 commit 965766a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

flake.nix

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@
897897
# Check if we're on a standard branch
898898
if [[ "$BRANCH" != "develop" && ! "$BRANCH" =~ ^release/ ]]; then
899899
echo "Warning: Running workflow from non-standard branch: $BRANCH"
900-
echo "This is allowed but may not be the intended behavior in production."
900+
echo "This is supported for testing purposes."
901901
read -p "Continue? [y/N] " -n 1 -r
902902
echo
903903
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
@@ -926,7 +926,17 @@
926926
echo "The script will automatically exit when the workflow completes."
927927
echo "Press Ctrl+C to stop watching (workflow will continue running)"
928928
echo "----------------------------------------"
929-
gh run watch "$RUN_ID" --exit-status
929+
930+
# Try to watch the run, but handle network errors gracefully
931+
while true; do
932+
if gh run watch "$RUN_ID" --exit-status; then
933+
break
934+
else
935+
echo "Network error while watching workflow. Retrying in 5 seconds..."
936+
echo "You can also check the status manually with: gh run view $RUN_ID"
937+
sleep 5
938+
fi
939+
done
930940
EOL
931941
chmod +x $out/bin/trigger-nix-build
932942
'';

0 commit comments

Comments
 (0)