Skip to content

Links

Links #1035

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/lychee-action@v2.1.0
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@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS_REVIEW }}
- name: Fetch secrets from key vault
uses: azure/CLI@v2
id: keyvault-yaml-secret
with:
inlineScript: |
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.KEY_VAULT_REVIEW }}" --query "value" -o tsv)
echo "::add-mask::$SLACK_WEBHOOK"
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
- 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 }}