Skip to content

Links

Links #640

Workflow file for this run

name: Links
on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "45 3 * * *"
jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: --exclude-mail --max-retries 20 app/views/content
fail: true
- uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: DfE-Digital/keyvault-yaml-secret@v1
id: keyvault-yaml-secret
with:
keyvault: ${{ secrets.KEY_VAULT}}
secret: INFRA-KEYS
key: SLACK-WEBHOOK
- name: Read Lychee output into var
id: lychee-output
if: ${{steps.lychee.outcome}} == "failure"
run: |
DATA=$(cat ./lychee/out.md)
echo "LYCHEE_OUTPUT<<EOF" >> $GITHUB_ENV
echo "$DATA" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Slack Markdown Converter
id: convert
if: ${{steps.lychee.outcome}} == "failure"
uses: LoveToKnow/slackify-markdown-action@v1
with:
text: |
${{ env.LYCHEE_OUTPUT }}
- name: Slack Notification
if: ${{steps.lychee.outcome}} == "failure"
uses: rtCamp/action-slack-notify@master
env:
SLACK_COLOR: ${{env.SLACK_ERROR}}
SLACK_MESSAGE: |
${{ steps.convert.outputs.text }}
SLACK_TITLE: 'External link check results:'
SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK-WEBHOOK }}