LinkChecker #392
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
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@1d6311ab61b4856de027ff508aac818ddc1e141b # v2.0.7 | |
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 }} |