Skip to content

Commit

Permalink
move doc link checker to cron / workflow dispatch (#7992)
Browse files Browse the repository at this point in the history
* move doc link checker to a cron

* change to test

* point at secret

* access environment for more-secrets

* improve formatting

* one more format update

* switch back to only cron / dispatch settings
  • Loading branch information
jrhizor authored Nov 15, 2021
1 parent ea738f1 commit 011ec29
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions .github/workflows/doc-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,47 @@
name: Doc Link Checker

on:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: '0 18 * * *'

jobs:
markdown-link-check:
timeout-minutes: 50
runs-on: ubuntu-latest
environment: more-secrets
steps:
- 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: ${{ secrets.DOC_LINK_CHECKER_BOT_TOKEN }}
with:
args: >-
{\"channel\": \"C02MG7B7MT6\", \"blocks\":[
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Succeeded! :white_check_mark:\n\"}},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":octavia-rocket: <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View Action Run> :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: ${{ secrets.DOC_LINK_CHECKER_BOT_TOKEN }}
with:
args: >-
{\"channel\": \"C02MG7B7MT6\", \"blocks\":[
{\"type\":\"divider\"},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Failed! :bangbang:\n\"}},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":octavia-rocket: <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View Action Run> :octavia-rocket:\"}},
{\"type\":\"divider\"}]}

0 comments on commit 011ec29

Please sign in to comment.