-
Notifications
You must be signed in to change notification settings - Fork 1.1k
52 lines (52 loc) · 1.87 KB
/
Copy pathcheck_for_broken_links.yml
File metadata and controls
52 lines (52 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: LinkChecker
on:
schedule:
- cron: '0 17 * * 1-5'
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
LinkChecker:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node.js 20
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20.x
- name: Set Yarn Berry
uses: ./.github/actions/set_yarn_berry
- name: Install Dependencies
run: yarn
- name: Run Link Checker
id: checkLinks
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
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@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
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@a9a7eb4e2f2871d30dc5b892576fde60a2ecc802 # v2.0.10
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@af78098f536edbc4de71162a307590698245be95 # v3.0.1
with:
payload: |
{
"message": "${{ steps.checkLinks.outputs.result }}"
}
env:
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL_SLACK_WEBHOOK_URL }}