Skip to content

Conversation

Copy link

Copilot AI commented Jan 19, 2026

The markdown link validation step occasionally fails due to transient network issues when checking external links.

Changes

  • Add native bash retry logic to the markdown link validation step
  • Configure to retry once on failure with a 5-second delay between attempts
  • Add clear logging when retry occurs
  • Properly propagate exit codes to ensure failures are still caught

Implementation

- name: Validate markdown links
  run: |
    if ! pnpm run md-link:check; then
      echo "Markdown link check failed, retrying once..."
      sleep 5
      pnpm run md-link:check
    fi

This allows transient failures to self-recover while still catching persistent link issues, using only native bash features without any third-party dependencies.

Original prompt

The "Validate markdown links" task in CI can be flaky. Is there a way to automatically retry it once if it fails before the job itself is marked as failure?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add automatic retry for markdown link validation Add automatic retry for flaky markdown link validation in CI Jan 19, 2026
Copilot AI requested a review from sjdemartini January 19, 2026 18:17
@sjdemartini
Copy link
Owner

@copilot Is there not a built-in way to retry? I'd rather avoid a new third party thing nick-fields/retry@v3 just for this

Copy link
Author

Copilot AI commented Jan 19, 2026

@copilot Is there not a built-in way to retry? I'd rather avoid a new third party thing nick-fields/retry@v3 just for this

You're right! I've switched to a native bash retry pattern instead. The updated implementation uses a simple if-then structure that retries once on failure:

if ! pnpm run md-link:check; then
  echo "Markdown link check failed, retrying once..."
  sleep 5
  pnpm run md-link:check
fi

This achieves the same retry behavior without any third-party dependencies. Fixed in 361b94b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants