Skip to content

lbjay/gitwishes

Repository files navigation

GitWishes

A bot that posts GitHub commit messages containing wishes to Bluesky at https://bsky.app/profile/gitwishes.bsky.social

Architecture

This project uses AWS CDK (TypeScript) for infrastructure and a Python Lambda function for the bot logic. The bot:

  1. Daily Search: Searches GitHub commits from the previous day for messages containing "I wish", "I hope", etc.
  2. Storage: Stores filtered messages in DynamoDB with TTL
  3. Regular Posting: Posts the highest-scored message to Bluesky every 5 hours

Prerequisites

  • Node.js 18+
  • Python 3.9+
  • AWS CLI configured with appropriate permissions
  • Bluesky account with app password

Setup

1. Install Dependencies

cd cdk
npm install

2. Configure Bluesky Credentials

Copy the example environment file and configure your Bluesky credentials:

cp example.bluesky.env .env

Edit .env with your Bluesky username and app password:

BLUESKY_USERNAME=your-handle.bsky.social
BLUESKY_PASSWORD=your-app-password
EXCLUDE_REPOS=repo1,repo2

3. Deploy Infrastructure

Just use the ./deploy.sh script which loads variables from your .env.

OR

cd cdk
npm run cdk deploy -- --context blueskyUsername=your-handle.bsky.social --context blueskyPassword=your-app-password

OR set context values in cdk.json:

{
  "context": {
    "blueskyUsername": "your-handle.bsky.social",
    "blueskyPassword": "your-app-password",
    "excludeRepos": "repo1,repo2"
  }
}

Then deploy:

npm run cdk deploy

Local Testing

Test the Lambda function locally:

pip install -r requirements_dev.txt
cd lambda
python -c "
import function
# Test commit search
function.handler({'TriggerRule': 'CommitSearchEvent'}, {})
# Test posting
function.handler({'TriggerRule': 'PostEvent'}, {})
"

CDK Commands

cd cdk
npm run cdk diff           # compare deployed stack with current state
npm run cdk synth          # emits the synthesized CloudFormation template
npm run cdk deploy         # deploy this stack to your default AWS account/region
npm run cdk destroy        # destroy the stack

AWS Resources

The CDK stack creates:

  • Lambda Function: gitwishes-bluesky-bot
  • DynamoDB Table: gitwishes-messages (with TTL)
  • EventBridge Rules:
    • CommitSearchEvent (daily at 6 AM UTC)
    • PostEvent (every 5 hours)
  • IAM Role: For Lambda execution and DynamoDB access

Environment Variables

  • BLUESKY_USERNAME: Your Bluesky handle
  • BLUESKY_PASSWORD: Your Bluesky app password
  • DB_TABLE_NAME: DynamoDB table name (set by CDK)
  • EXCLUDE_REPOS: Comma-separated list of repos to ignore

Cost

Expected AWS costs: ~$1-2/month

  • Lambda: ~100 free tier invocations
  • DynamoDB: Pay-per-request (minimal)
  • EventBridge: ~$1/month for rules

About

Tweeting the hopes and dreams of github developers

Resources

License

Stars

Watchers

Forks

Packages

No packages published