diff --git a/.github/ISSUE_TEMPLATE/broken-link-report.md b/.github/ISSUE_TEMPLATE/broken-link-report.md new file mode 100644 index 0000000..30e74f0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/broken-link-report.md @@ -0,0 +1,8 @@ +--- +name: Broken link report +about: Automated issue template for reporting link checker fails +title: Failing link check ({{ date | date('dddd, MMMM Do') }}) +labels: automated issue, bug, documentation, broken links +--- + +The broken link check failed. Check [the workflow logs](https://https://github.com/keptn-sandbox/new-keptn-docs-engine/actions/workflows/daily-link-checker.yaml) to identify the failing links. diff --git a/.github/workflows/daily-link-checker.yaml b/.github/workflows/daily-link-checker.yaml new file mode 100644 index 0000000..2d7ae6f --- /dev/null +++ b/.github/workflows/daily-link-checker.yaml @@ -0,0 +1,39 @@ +name: Check all markdown links daily + +on: + schedule: + - cron: '0 23 * * *' + +permissions: + contents: read + issues: write + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + # checks all markdown files from /docs including all subfolders + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.github/workflows/markdown.links.config.json' + folder-path: 'docs/' + - uses: actions/checkout@master + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + # checks all markdown files from the root but ignores subfolders + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.github/workflows/markdown.links.config.json' + max-depth: 0 + + # Automatically create an issue if there are broken links + - name: Create issue + if: ${{ failure() }} + uses: JasonEtco/create-an-issue@9e6213aec58987fa7d2f4deb8b256b99e63107a2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + filename: .github/ISSUE_TEMPLATE/broken-link-report.md diff --git a/.github/workflows/markdown.links.config.json b/.github/workflows/markdown.links.config.json new file mode 100644 index 0000000..48c3a0c --- /dev/null +++ b/.github/workflows/markdown.links.config.json @@ -0,0 +1,13 @@ +{ + "replacementPatterns": [ + { + "pattern": "^/", + "replacement": "https://keptn-experimental-docs-site.netlify.app/" + } + ], + "ignorePatterns": [ + { + "pattern": "^https?://localhost" + } + ] +}