diff --git a/.github/ISSUE_TEMPLATE/broken-link.md b/.github/ISSUE_TEMPLATE/broken-link.md new file mode 100644 index 0000000..faa5124 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/broken-link.md @@ -0,0 +1,8 @@ +--- +name: Broken link detected by CI +labels: bug +--- + + + +Periodic link aliveness CI detected a broken link. Please see the job results for details. diff --git a/.github/workflows/md-links-periodic.yml b/.github/workflows/md-links-periodic.yml new file mode 100644 index 0000000..a65cf1a --- /dev/null +++ b/.github/workflows/md-links-periodic.yml @@ -0,0 +1,25 @@ +name: Markdown Link Checks +on: + schedule: + - cron: "0 0 * * 0" + +jobs: + markdown-link-check-periodic: + runs-on: ubuntu-latest + name: Markdown Link Checks + steps: + - name: Check out code + uses: actions/checkout@v1 + + - name: Run markdown-link-check + uses: gaurav-nelson/github-action-markdown-link-check@0.6.0 + with: + config-file: ".markdownlinkcheck.json" + + - name: Raise an Issue to report broken links + if: ${{ failure() }} + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + filename: .github/ISSUE_TEMPLATE/broken-link.md diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml new file mode 100644 index 0000000..29b4150 --- /dev/null +++ b/.github/workflows/md-links.yml @@ -0,0 +1,16 @@ +name: Markdown Link Checks +on: pull_request + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + name: Markdown Link Checks + steps: + - name: Check out code + uses: actions/checkout@v1 + + - name: Run markdown-link-check + uses: gaurav-nelson/github-action-markdown-link-check@0.6.0 + with: + config-file: ".markdownlinkcheck.json" + check-modified-files-only: "yes" diff --git a/.markdownlinkcheck.json b/.markdownlinkcheck.json new file mode 100644 index 0000000..6d70d33 --- /dev/null +++ b/.markdownlinkcheck.json @@ -0,0 +1,10 @@ +{ + "ignorePatterns": [ + { + "pattern": "^https://github.com/\\S+/\\S+/(issues|pull)/[0-9]+" + }, + { + "pattern": "^http://localhost:" + } + ] +}