diff --git a/.github/workflows/check_for_broken_links.yml b/.github/workflows/check_for_broken_links.yml index f53a73f8b43..9bb404d9a81 100644 --- a/.github/workflows/check_for_broken_links.yml +++ b/.github/workflows/check_for_broken_links.yml @@ -1,7 +1,5 @@ name: LinkChecker on: - schedule: - - cron: '0 17 * * 1-5' workflow_dispatch: permissions: contents: read @@ -18,33 +16,42 @@ jobs: node-version: 16.x - name: Install Dependencies run: yarn + - name: Run Build + run: yarn build + env: + NODE_OPTIONS: --max_old_space_size=4096 + - name: Serve Files + uses: Eun/http-server-action@v1 + with: + directory: ${{ github.workspace }} + port: 3000 + no-cache: false + index-files: | + ["index.html", "index.htm"] + allowed-methods: | + ["GET", "HEAD"] + content-types: | + { + "appcache": "text/cache-manifest", + "css": "text/css", + "gif": "image/gif", + "html": "text/html", + "ico": "image/x-icon", + "jpeg": "image/jpeg", + "jpg": "image/jpeg", + "js": "text/javascript", + "json": "application/json", + "png": "image/png", + "txt": "text/plain", + "xml": "text/xml" + } + log: "log.txt" + logTime: "false" - name: Run Link Checker id: checkLinks uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 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@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.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@022e8919774ecb75e8e375656d7b1898936ab878 # v1.0.4 - 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@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 - with: - payload: | - { - "message": "${{ steps.checkLinks.outputs.result }}" - } - env: - SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL_SLACK_WEBHOOK_URL }} + const { checkDevLinks } = require('./tasks/link-checker.js'); + return await checkDevLinks();