Cloudflare Edge Hardening #1
This file contains hidden or 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: 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 |