cloudflare-d1-weekly-backup-via-pr

Automate weekly Cloudflare D1 database backups via GitHub Actions pull requests.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/okayus/okayus-skills --skill cloudflare-d1-weekly-backup-via-pr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-d1-weekly-backup-via-pr
Source: https://github.com/okayus/okayus-skills/tree/main/skills/cloudflare-d1-weekly-backup-via-pr
Command: npx skills add https://github.com/okayus/okayus-skills --skill cloudflare-d1-weekly-backup-via-pr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of creating reliable Cloudflare D1 database backups without manually exporting data, managing storage workflows, or discovering GitHub Actions permission issues during setup.

Core Features & Use Cases

  • Automated Backup Workflow: Creates a GitHub Actions process that exports production D1 databases on a schedule and opens pull requests containing backup files for review.
  • Production Setup Guidance: Handles common deployment details including GitHub Actions PR permissions, workflow token scopes, UTC cron scheduling, and monorepo export path handling.
  • Use Case: A Cloudflare Workers application owner can use this Skill to create a weekly SQL backup process that generates reviewable recovery snapshots directly in a private repository.

Quick Start

Ask the cloudflare-d1-weekly-backup-via-pr skill to set up a weekly Cloudflare D1 backup workflow that exports my production database and opens a pull request for review.

Frequently Asked Questions about cloudflare-d1-weekly-backup-via-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Cloudflare D1 database backups with GitHub Actions?

You can automate Cloudflare D1 database backups by creating a GitHub Actions workflow that uses wrangler to export production data on a UTC cron schedule and opens a pull request containing the SQL backup file for review.

Why do my GitHub Actions workflows fail when opening pull requests for D1 backups?

GitHub Actions workflows for D1 backups often fail due to incorrect pull request permissions and insufficient workflow token scopes. You must configure the proper GitHub Actions PR permissions and token scopes to allow automated pull request creation.

What is the best way to schedule weekly SQL exports for a Cloudflare Workers application?

The best way to schedule weekly SQL exports for a Cloudflare Workers application is using a GitHub Actions cron schedule that triggers wrangler to export the D1 database and commit the backup file to a private repository via a reviewable pull request.

Can I use GitHub Actions to backup a D1 database in a pnpm monorepo?

Yes, you can backup a D1 database in a pnpm monorepo using GitHub Actions. The workflow needs specific monorepo export path handling to ensure the wrangler SQL export files are correctly placed and committed within the monorepo structure.

Do I need special GitHub token permissions to automate D1 backups via pull requests?

Yes, automating D1 backups via pull requests requires specific GitHub token permissions. You need to configure workflow token scopes and pull request permissions to allow the GitHub Actions runner to create branches and open pull requests in your repository.

How do I validate a Cloudflare D1 backup file generated by a GitHub Action?

Validating a Cloudflare D1 backup involves checking the exported SQL file generated by the GitHub Actions workflow. The backup process includes guidance for backup validation to ensure your recovery snapshots are complete and usable before merging the pull request.