Check Cloudflare redirects #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: 'Check Cloudflare redirects' | |
# yamllint disable-line rule:truthy | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '25 10 * * 2' | |
permissions: | |
contents: read | |
jobs: | |
redirects: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Check Cloudflare redirects | |
run: | | |
awk '{print "https://docs.opensafely.org"$1}' docs/_redirects | xargs -n1 curl -o /dev/null --silent --head --write-out '%{url_effective} %{http_code} \n' > redirect_check_results | |
cat redirect_check_results | |
diff <(awk '{print $NF}' redirect_check_results) <(awk '{print $NF}' docs/_redirects) |