Skip to content

LinkChecker

LinkChecker #313

name: LinkChecker
on:
schedule:
- cron: '0 17 * * 1-5'
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
LinkChecker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Setup Node.js 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- name: Install Dependencies
run: yarn
- name: Run Link Checker
id: checkLinks
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
result-encoding: string
script: |
const { checkProdLinks } = require('./tasks/link-checker.js');
return await checkProdLinks();
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: arn:aws:iam::464149486631:role/github_action_read_slack_webhook_url
aws-region: us-west-2
- name: Read secrets from AWS Secrets Manager into environment variables
uses: aws-actions/aws-secretsmanager-get-secrets@ff26a0aa6bd4dd5e51326b5afb3f5f6874c958c7 # v2.0.3
with:
secret-ids: |
SLACK_WEBHOOK_URL
parse-json-secrets: true
- name: Send custom JSON data to Slack workflow
if: steps.checkLinks.outputs.result
id: slack
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
with:
payload: |
{
"message": "${{ steps.checkLinks.outputs.result }}"
}
env:
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL_SLACK_WEBHOOK_URL }}