name: Check Markdown links
on: 
  pull_request:
    paths:
      - "docs/**"
jobs:
  markdown-link-check:
    runs-on: depot-ubuntu-22.04-4
    steps:
      - uses: actions/checkout@v6
      - run: cd docs && sh ./pre.sh
      - uses: gaurav-nelson/github-action-markdown-link-check@1.0.17
        with:
          folder-path: "docs"
      - run: cd docs && sh ./post.sh
  sims-notify-failure:
    permissions:
      contents: none
    runs-on: depot-ubuntu-22.04-4
    if: ${{ failure() }}
    steps:
      - name: Notify Slack on failure
        uses: rtCamp/action-slack-notify@v2.4.0
        env:
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
          SLACK_CHANNEL: sdk-sims
          SLACK_USERNAME: Broken Links
          SLACK_ICON_EMOJI: ":skull:"
          SLACK_COLOR: danger
          SLACK_MESSAGE: Links are broken in docs
          SLACK_FOOTER: ""
