Skip to content

Daily CSP IP Ranges Fetch #155

Daily CSP IP Ranges Fetch

Daily CSP IP Ranges Fetch #155

name: Daily CSP IP Ranges Fetch
on:
schedule:
- cron: '0 2 * * *' # Run every day at 2 AM UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
fetch:
runs-on: ubuntu-latest
name: Fetch CSP Ranges
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Install dependencies
run: npm ci
- name: Fetch CSP IP ranges
run: npm run fetch
- name: Check if there are changes
id: verify-changed-files
run: |
if [[ -n "$(git status --porcelain -- data/)" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data/
git commit -m "chore: update CSP IP ranges [skip ci]"
git push