From 7957cad2eab5e972485be6c06f49df1272dd2cab Mon Sep 17 00:00:00 2001 From: Jared Rhizor Date: Mon, 15 Nov 2021 12:07:21 -0800 Subject: [PATCH 1/7] move doc link checker to a cron --- .github/workflows/doc-link-check.yml | 44 +++++++++++++++++++++------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/doc-link-check.yml b/.github/workflows/doc-link-check.yml index 1a52e49cd9b0..a58c3a4dbd4b 100644 --- a/.github/workflows/doc-link-check.yml +++ b/.github/workflows/doc-link-check.yml @@ -3,9 +3,9 @@ name: Doc Link Checker on: - push: - branches: - - master + workflow_dispatch: + schedule: + - cron: '0 18 * * *' jobs: markdown-link-check: @@ -15,15 +15,37 @@ jobs: - uses: actions/checkout@master # check all files on master - uses: gaurav-nelson/github-action-markdown-link-check@v1 - if: github.ref == 'refs/heads/master' with: use-quiet-mode: 'yes' check-modified-files-only: 'no' config-file: .github/workflows/doc-link-check.json -# # check changed files for branches -# - uses: gaurav-nelson/github-action-markdown-link-check@v1 -# if: github.ref != 'refs/heads/master' -# with: -# use-quiet-mode: 'yes' -# check-modified-files-only: 'yes' -# config-file: .github/workflows/doc-link-check.json + + # posts to #_doc_link_checker + - name: Publish Success to Slack + if: success() + uses: abinoda/slack-action@master + env: + SLACK_BOT_TOKEN: ${{ inputs.slackbot_token }} + with: + args: >- + {\"channel\": \"C02MG7B7MT6\", \"blocks\":[ + {\"type\":\"divider\"}, + {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Doc Link Checker* ran successfully! :white_check_mark:\n\n\"}}, + {\"type\":\"divider\"}, + {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":octavia-rocket: :octavia-rocket:\"}}, + {\"type\":\"divider\"}]} + + # posts to #_doc_link_checker + - name: Publish Failure to Slack + if: failure() + uses: abinoda/slack-action@master + env: + SLACK_BOT_TOKEN: ${{ inputs.slackbot_token }} + with: + args: >- + {\"channel\": \"C02MG7B7MT6\", \"blocks\":[ + {\"type\":\"divider\"}, + {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Doc Link Checker* failed! :bangbang:\n\n\"}}, + {\"type\":\"divider\"}, + {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":octavia-rocket: :octavia-rocket:\"}}, + {\"type\":\"divider\"}]} From 723ec1de0d1f9ce6ffba6ae99cf421ef54f23751 Mon Sep 17 00:00:00 2001 From: Jared Rhizor Date: Mon, 15 Nov 2021 12:09:17 -0800 Subject: [PATCH 2/7] change to test --- .github/workflows/doc-link-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/doc-link-check.yml b/.github/workflows/doc-link-check.yml index a58c3a4dbd4b..3c0abd57130b 100644 --- a/.github/workflows/doc-link-check.yml +++ b/.github/workflows/doc-link-check.yml @@ -3,6 +3,7 @@ name: Doc Link Checker on: + push: workflow_dispatch: schedule: - cron: '0 18 * * *' @@ -17,7 +18,7 @@ jobs: - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: use-quiet-mode: 'yes' - check-modified-files-only: 'no' + check-modified-files-only: 'yes' config-file: .github/workflows/doc-link-check.json # posts to #_doc_link_checker From fc82cde244d5521af67c0d8df9554544c78077f0 Mon Sep 17 00:00:00 2001 From: Jared Rhizor Date: Mon, 15 Nov 2021 12:25:37 -0800 Subject: [PATCH 3/7] point at secret --- .github/workflows/doc-link-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/doc-link-check.yml b/.github/workflows/doc-link-check.yml index 3c0abd57130b..820ca5219b38 100644 --- a/.github/workflows/doc-link-check.yml +++ b/.github/workflows/doc-link-check.yml @@ -26,7 +26,7 @@ jobs: if: success() uses: abinoda/slack-action@master env: - SLACK_BOT_TOKEN: ${{ inputs.slackbot_token }} + SLACK_BOT_TOKEN: ${{ secrets.DOC_LINK_CHECKER_BOT_TOKEN }} with: args: >- {\"channel\": \"C02MG7B7MT6\", \"blocks\":[ @@ -41,7 +41,7 @@ jobs: if: failure() uses: abinoda/slack-action@master env: - SLACK_BOT_TOKEN: ${{ inputs.slackbot_token }} + SLACK_BOT_TOKEN: ${{ secrets.DOC_LINK_CHECKER_BOT_TOKEN }} with: args: >- {\"channel\": \"C02MG7B7MT6\", \"blocks\":[ From cd55447f1ba18aba840663ffd01a733ce3de9449 Mon Sep 17 00:00:00 2001 From: Jared Rhizor Date: Mon, 15 Nov 2021 12:29:25 -0800 Subject: [PATCH 4/7] access environment for more-secrets --- .github/workflows/doc-link-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/doc-link-check.yml b/.github/workflows/doc-link-check.yml index 820ca5219b38..b5ff9c954da4 100644 --- a/.github/workflows/doc-link-check.yml +++ b/.github/workflows/doc-link-check.yml @@ -12,6 +12,7 @@ jobs: markdown-link-check: timeout-minutes: 50 runs-on: ubuntu-latest + environment: more-secrets steps: - uses: actions/checkout@master # check all files on master From 06fa32aed348442e4b28d3cb817c6dde8d5bc23e Mon Sep 17 00:00:00 2001 From: Jared Rhizor Date: Mon, 15 Nov 2021 12:32:05 -0800 Subject: [PATCH 5/7] improve formatting --- .github/workflows/doc-link-check.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/doc-link-check.yml b/.github/workflows/doc-link-check.yml index b5ff9c954da4..3b29e38af3df 100644 --- a/.github/workflows/doc-link-check.yml +++ b/.github/workflows/doc-link-check.yml @@ -31,8 +31,7 @@ jobs: with: args: >- {\"channel\": \"C02MG7B7MT6\", \"blocks\":[ - {\"type\":\"divider\"}, - {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Doc Link Checker* ran successfully! :white_check_mark:\n\n\"}}, + {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Succeeded! :white_check_mark:\n\n\n\"}}, {\"type\":\"divider\"}, {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":octavia-rocket: :octavia-rocket:\"}}, {\"type\":\"divider\"}]} @@ -47,7 +46,7 @@ jobs: args: >- {\"channel\": \"C02MG7B7MT6\", \"blocks\":[ {\"type\":\"divider\"}, - {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Doc Link Checker* failed! :bangbang:\n\n\"}}, + {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Failed! :bangbang:\n\n\n\"}}, {\"type\":\"divider\"}, {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":octavia-rocket: :octavia-rocket:\"}}, {\"type\":\"divider\"}]} From 7875b44ce23e1d218965599cea6488af0f318407 Mon Sep 17 00:00:00 2001 From: Jared Rhizor Date: Mon, 15 Nov 2021 12:34:02 -0800 Subject: [PATCH 6/7] one more format update --- .github/workflows/doc-link-check.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/doc-link-check.yml b/.github/workflows/doc-link-check.yml index 3b29e38af3df..70b923355e49 100644 --- a/.github/workflows/doc-link-check.yml +++ b/.github/workflows/doc-link-check.yml @@ -31,8 +31,7 @@ jobs: with: args: >- {\"channel\": \"C02MG7B7MT6\", \"blocks\":[ - {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Succeeded! :white_check_mark:\n\n\n\"}}, - {\"type\":\"divider\"}, + {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Succeeded! :white_check_mark:\n\"}}, {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":octavia-rocket: :octavia-rocket:\"}}, {\"type\":\"divider\"}]} @@ -46,7 +45,6 @@ jobs: args: >- {\"channel\": \"C02MG7B7MT6\", \"blocks\":[ {\"type\":\"divider\"}, - {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Failed! :bangbang:\n\n\n\"}}, - {\"type\":\"divider\"}, + {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Failed! :bangbang:\n\"}}, {\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":octavia-rocket: :octavia-rocket:\"}}, {\"type\":\"divider\"}]} From b5b73b876e678399c4a72f8ef86be9c12e78aa8e Mon Sep 17 00:00:00 2001 From: Jared Rhizor Date: Mon, 15 Nov 2021 12:35:36 -0800 Subject: [PATCH 7/7] switch back to only cron / dispatch settings --- .github/workflows/doc-link-check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/doc-link-check.yml b/.github/workflows/doc-link-check.yml index 70b923355e49..e7eca0abaf1a 100644 --- a/.github/workflows/doc-link-check.yml +++ b/.github/workflows/doc-link-check.yml @@ -3,7 +3,6 @@ name: Doc Link Checker on: - push: workflow_dispatch: schedule: - cron: '0 18 * * *' @@ -19,7 +18,7 @@ jobs: - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: use-quiet-mode: 'yes' - check-modified-files-only: 'yes' + check-modified-files-only: 'no' config-file: .github/workflows/doc-link-check.json # posts to #_doc_link_checker