Skip to content

Check 508 Compliance #108

Check 508 Compliance

Check 508 Compliance #108

name: Check 508 Compliance
on:
schedule:
- cron: 17 8 * * 1
workflow_dispatch:
inputs:
target_host:
description: Check where?
required: true
default: 'https://stage.dpc.cms.gov'
type: choice
options:
- 'https://stage.dpc.cms.gov'
- 'https://dpc.cms.gov'
jobs:
compliance_check:
name: Compliance Check
runs-on: codebuild-dpc-static-site${{
contains('https://dpc.cms.gov', inputs.target_host) && '-prod' || '-non-prod'
}}-${{github.run_id}}-${{github.run_attempt}}
steps:
- name: Set Target Base
id: target-base
run: |
echo "TARGET_BASE_URL=${{ inputs.target_host || 'https://stage.dpc.cms.gov' }}" >> "$GITHUB_OUTPUT"
- name: Run Axe Check
env:
TARGET_BASE_URL: ${{ steps.target-base.outputs.TARGET_BASE_URL }}
run: |
TARGETS_TO_SCAN="${TARGET_BASE_URL}"
TARGETS_TO_SCAN="${TARGETS_TO_SCAN} ${TARGET_BASE_URL}/faq.html"
TARGETS_TO_SCAN="${TARGETS_TO_SCAN} ${TARGET_BASE_URL}/data.html"
TARGETS_TO_SCAN="${TARGETS_TO_SCAN} ${TARGET_BASE_URL}/pilot.html"
TARGETS_TO_SCAN="${TARGETS_TO_SCAN} ${TARGET_BASE_URL}/docsV1.html"
TARGETS_TO_SCAN="${TARGETS_TO_SCAN} ${TARGET_BASE_URL}/docsV2.html"
TARGETS_TO_SCAN="${TARGETS_TO_SCAN} ${TARGET_BASE_URL}/updates.html"
docker run --init --rm --cap-add=SYS_ADMIN mcp/puppeteer:latest@sha256:11bacd79778b42ebe041a9e2fc18a8c3500bf1362e5bca5bf2ae9dd011be5847 $TARGETS_TO_SCAN
- uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
name: Slack Success
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
# Sends to dpc-deploys
payload: |
channel: "CMC1E4AEQ"
attachments:
- color: good
text: "SUCCESS: <${{ github.server_url}}/${{ github.repository}}/actions/runs/${{ github.run_id }}|Static Site 508 Compliance> completed against `${{ steps.target-base.outputs.TARGET_BASE_URL }}`"
mrkdown_in:
- text
- uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
name: Slack failure
if: ${{ failure() }}
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
# Sends to dpc-deploys
payload: |
channel: "CMC1E4AEQ"
attachments:
- color: danger
text: "FAILURE: <${{ github.server_url}}/${{ github.repository}}/actions/runs/${{ github.run_id }}|Static Site 508 Compliance> completed against `${{ steps.target-base.outputs.TARGET_BASE_URL }}`"
mrkdown_in:
- text