From 294767e0567c0c47400a007bae35cf13f9508136 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sat, 25 Mar 2023 15:34:11 +0300 Subject: [PATCH 01/11] chore(ci): add an automatic check to verify markdown links. As per #6793, there are multiple broken links in our docs. This action will check if all markdown links are valid. cc: @ammario @bpmct --- .github/workflows/contrib.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/contrib.yaml b/.github/workflows/contrib.yaml index 36a0460fbb229..509ce1653449e 100644 --- a/.github/workflows/contrib.yaml +++ b/.github/workflows/contrib.yaml @@ -58,6 +58,17 @@ jobs: with: requireScope: false + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: 'mlc_config.json' + folder-path: 'docs' + release-labels: runs-on: ubuntu-latest # Depend on lint so that title is Conventional Commits-compatible. From 039b393f0b2c990b7d10c80d2c48393c1f42b126 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 27 Mar 2023 23:38:50 +0300 Subject: [PATCH 02/11] Revert "chore(ci): add an automatic check to verify markdown links. " This reverts commit 294767e0567c0c47400a007bae35cf13f9508136. --- .github/workflows/contrib.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/contrib.yaml b/.github/workflows/contrib.yaml index 509ce1653449e..36a0460fbb229 100644 --- a/.github/workflows/contrib.yaml +++ b/.github/workflows/contrib.yaml @@ -58,17 +58,6 @@ jobs: with: requireScope: false - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - config-file: 'mlc_config.json' - folder-path: 'docs' - release-labels: runs-on: ubuntu-latest # Depend on lint so that title is Conventional Commits-compatible. From 3b03b91c490dce722aeb428cb30e6f3915667949 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 00:23:10 +0300 Subject: [PATCH 03/11] Create cron-weekly.yaml --- .github/workflows/cron-weekly.yaml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/cron-weekly.yaml diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml new file mode 100644 index 0000000000000..58877679426bd --- /dev/null +++ b/.github/workflows/cron-weekly.yaml @@ -0,0 +1,38 @@ +name: Markdown Links Check +# runs every monday at 9 am +on: + schedule: + - cron: "0 9 * * 1" + +jobs: + check-links: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Check Markdown links + uses: gaurav-nelson/github-action-markdown-link-check@v1 + id: markdown-link-check + # 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/' + + post-to-slack: + runs-on: ubuntu-latest + needs: check-links + if: ${{ always() }} + steps: + - name: Post to Slack + id: post-to-slack + uses: slackapi/slack-github-action@v1.23.0 + with: + payload: | + { + "msg": "${{ steps.markdown-link-check.outputs}}", + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.DOCS_LINK_SLACK_WEBHOOK }} From 088fbe0419ca3f967dc52c8244554d7c7e23292a Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 00:23:49 +0300 Subject: [PATCH 04/11] add workflow dispatch for testing --- .github/workflows/cron-weekly.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml index 58877679426bd..04df8d65f50e9 100644 --- a/.github/workflows/cron-weekly.yaml +++ b/.github/workflows/cron-weekly.yaml @@ -3,6 +3,8 @@ name: Markdown Links Check on: schedule: - cron: "0 9 * * 1" + workflow_dispatch: + jobs: check-links: From 5f82bf033b2b22d569ff424e647a32d1ded31fad Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 00:27:25 +0300 Subject: [PATCH 05/11] fmt --- .github/workflows/cron-weekly.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml index 04df8d65f50e9..2e5651ad7cc39 100644 --- a/.github/workflows/cron-weekly.yaml +++ b/.github/workflows/cron-weekly.yaml @@ -5,7 +5,6 @@ on: - cron: "0 9 * * 1" workflow_dispatch: - jobs: check-links: runs-on: ubuntu-latest @@ -18,10 +17,10 @@ jobs: id: markdown-link-check # 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/' + use-quiet-mode: "yes" + use-verbose-mode: "yes" + config-file: ".github/workflows/markdown.links.config.json" + folder-path: "docs/" post-to-slack: runs-on: ubuntu-latest From 56b15a4fb21fbbd681ed27814a76e54bc814ee85 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 00:27:48 +0300 Subject: [PATCH 06/11] Update cron-weekly.yaml --- .github/workflows/cron-weekly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml index 2e5651ad7cc39..43fc598f0cfa4 100644 --- a/.github/workflows/cron-weekly.yaml +++ b/.github/workflows/cron-weekly.yaml @@ -3,7 +3,7 @@ name: Markdown Links Check on: schedule: - cron: "0 9 * * 1" - workflow_dispatch: + workflow_dispatch: # allows to run manually for testing jobs: check-links: From 8e7a4ea56698478ce5b2c1ad958d80efdfc0adbf Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 01:04:31 +0300 Subject: [PATCH 07/11] remove slack notification for now --- .github/workflows/cron-weekly.yaml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml index 43fc598f0cfa4..63ee7b0722b89 100644 --- a/.github/workflows/cron-weekly.yaml +++ b/.github/workflows/cron-weekly.yaml @@ -21,19 +21,3 @@ jobs: use-verbose-mode: "yes" config-file: ".github/workflows/markdown.links.config.json" folder-path: "docs/" - - post-to-slack: - runs-on: ubuntu-latest - needs: check-links - if: ${{ always() }} - steps: - - name: Post to Slack - id: post-to-slack - uses: slackapi/slack-github-action@v1.23.0 - with: - payload: | - { - "msg": "${{ steps.markdown-link-check.outputs}}", - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.DOCS_LINK_SLACK_WEBHOOK }} From 28b572ccdeeb7cf3caefb1d121b455df54745323 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 01:44:30 +0300 Subject: [PATCH 08/11] Add slack notification --- .github/workflows/cron-weekly.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml index 63ee7b0722b89..0bde2c96b190b 100644 --- a/.github/workflows/cron-weekly.yaml +++ b/.github/workflows/cron-weekly.yaml @@ -21,3 +21,8 @@ jobs: use-verbose-mode: "yes" config-file: ".github/workflows/markdown.links.config.json" folder-path: "docs/" + + - name: Send Slack notification + run: | + curl -X POST -H 'Content-type: application/json' -d '{"msg":"Broken links found in the documentation. Please check the logs."}' ${{ secrets.DOCS_LINK_SLACK_WEBHOOK }} + echo "Sent Slack notification" From 9f0e81929aebf9e2e7b4e228f09a0da576b33306 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 01:45:07 +0300 Subject: [PATCH 09/11] Update cron-weekly.yaml --- .github/workflows/cron-weekly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml index 0bde2c96b190b..d0e23b74782d7 100644 --- a/.github/workflows/cron-weekly.yaml +++ b/.github/workflows/cron-weekly.yaml @@ -6,7 +6,7 @@ on: workflow_dispatch: # allows to run manually for testing jobs: - check-links: + check-docs: runs-on: ubuntu-latest steps: - name: Checkout From 265889e77e8655b5d932c6d0b301dab21ddf8da8 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 01:56:00 +0300 Subject: [PATCH 10/11] Add logs URL --- .github/workflows/cron-weekly.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml index d0e23b74782d7..6082b1073c34e 100644 --- a/.github/workflows/cron-weekly.yaml +++ b/.github/workflows/cron-weekly.yaml @@ -24,5 +24,9 @@ jobs: - name: Send Slack notification run: | - curl -X POST -H 'Content-type: application/json' -d '{"msg":"Broken links found in the documentation. Please check the logs."}' ${{ secrets.DOCS_LINK_SLACK_WEBHOOK }} + curl -X POST -H 'Content-type: application/json' -d '{"msg":"Broken links found in the documentation. Please check the logs at ${{ env.LOGS_URL }}"}' ${{ secrets.DOCS_LINK_SLACK_WEBHOOK }} echo "Sent Slack notification" + env: + LOGS_URL: ${{ https://github.com/coder/coder/actions/runs/${{ github.run_id }} + + From 412158bdfc514ca70d30c60e62f5853ce2fba66b Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 28 Mar 2023 02:00:55 +0300 Subject: [PATCH 11/11] fmt --- .github/workflows/cron-weekly.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml index 6082b1073c34e..b1e3c496a79c1 100644 --- a/.github/workflows/cron-weekly.yaml +++ b/.github/workflows/cron-weekly.yaml @@ -28,5 +28,3 @@ jobs: echo "Sent Slack notification" env: LOGS_URL: ${{ https://github.com/coder/coder/actions/runs/${{ github.run_id }} - -