GitHub Gist Store
Store subscribers in a private GitHub Gist — ideal for public repos where you can’t commit a subscribers.json file without exposing email addresses.
Why use this?
Section titled “Why use this?”The JSON file store requires subscribers.json to be checked into the repo so GitHub Actions can read it. In a public repo, that means subscriber emails are visible to anyone. The Gist store solves this by keeping the same JSON format in a private Gist that’s only accessible via the GitHub API with a token.
1. Create a private Gist
Section titled “1. Create a private Gist”Create a new secret Gist with a file named subscribers.json:
[]Copy the Gist ID from the URL (e.g., https://gist.github.com/yourname/abc123def456 → abc123def456).
2. Create a classic PAT with gist scope
Section titled “2. Create a classic PAT with gist scope”The default GITHUB_TOKEN in Actions is scoped to the repository and cannot access private gists. Create a classic PAT and check the gist scope.
3. Add repository secrets
Section titled “3. Add repository secrets”gh secret set SUBSCRIBERS_GIST_ID --body "abc123def456"gh secret set SUBSCRIBERS_GIST_TOKEN --body "ghp_your_pat_here"4. Set environment variables (local dev)
Section titled “4. Set environment variables (local dev)”export SUBSCRIBER_STORE=gistexport GITHUB_GIST_ID=abc123def456export GITHUB_TOKEN=ghp_your_pat_hereConfiguration
Section titled “Configuration”| Variable | Required | Description |
|---|---|---|
GITHUB_GIST_ID | Yes | ID of the private Gist |
GITHUB_TOKEN | Yes | Classic PAT with gist scope (fine-grained PATs do not support gists; the default Actions token cannot access private gists) |
File format
Section titled “File format”The Gist uses the same JSON format as the JSON file store:
[ { "email": "alice@example.com", "name": "Alice", "productIds": ["my-app", "other-app"] }, { "email": "bob@example.com", "productIds": ["my-app"] }]Audience compound keys work the same way:
[ { "email": "alice@example.com", "productIds": ["my-app:beta"] }]Email logging
Section titled “Email logging”Sent emails are logged to an email-log.json file in the same Gist (created automatically on first send).
GitHub Actions usage
Section titled “GitHub Actions usage”- uses: atriumn/cryyer/.github/actions/send-file@v0 with: product: my-app draft-path: drafts/v1.2.0.md from-email: updates@yourdomain.com email-api-key: ${{ secrets.RESEND_API_KEY }} subscriber-store: gist github-gist-id: ${{ secrets.SUBSCRIBERS_GIST_ID }} github-token: ${{ secrets.SUBSCRIBERS_GIST_TOKEN }}Managing subscribers
Section titled “Managing subscribers”You can manage subscribers through any of the standard Cryyer interfaces:
- MCP tools:
add_subscriber,remove_subscriber,list_subscribers - Directly: Edit the Gist at
https://gist.github.com/{id} - GitHub CLI:
gh gist edit {id}