Skip to content

Commit 24a6ee5

Browse files
committed
feat: retry
1 parent d713475 commit 24a6ee5

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
@@ -899,7 +899,7 @@
899899
# Check if we're on a standard branch
900900
if [[ "$BRANCH" != "develop" && ! "$BRANCH" =~ ^release/ ]]; then
901901
echo "Warning: Running workflow from non-standard branch: $BRANCH"
902-
echo "This is allowed but may not be the intended behavior in production."
902+
echo "This is supported for testing purposes."
903903
read -p "Continue? [y/N] " -n 1 -r
904904
echo
905905
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
@@ -928,7 +928,17 @@
928928
echo "The script will automatically exit when the workflow completes."
929929
echo "Press Ctrl+C to stop watching (workflow will continue running)"
930930
echo "----------------------------------------"
931-
gh run watch "$RUN_ID" --exit-status
931+
932+
# Try to watch the run, but handle network errors gracefully
933+
while true; do
934+
if gh run watch "$RUN_ID" --exit-status; then
935+
break
936+
else
937+
echo "Network error while watching workflow. Retrying in 5 seconds..."
938+
echo "You can also check the status manually with: gh run view $RUN_ID"
939+
sleep 5
940+
fi
941+
done
932942
EOL
933943
chmod +x $out/bin/trigger-nix-build
934944
'';

0 commit comments

Comments
 (0)