Skip to content

Cloudflare Edge Hardening #1

Cloudflare Edge Hardening

Cloudflare Edge Hardening #1

name: Cloudflare Edge Hardening
# GitHub Pages ignores `_headers`, so the live security headers (CSP etc.)
# are set by scripts/cloudflare-edge-hardening.sh as Transform Rules at the
# Cloudflare edge. Run this whenever the script changes, or manually after
# editing header values.
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'scripts/cloudflare-edge-hardening.sh'
permissions:
contents: read
jobs:
harden:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Apply edge rules
env:
CF_API_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN_GITHUB }}
run: bash scripts/cloudflare-edge-hardening.sh