A bot that posts GitHub commit messages containing wishes to Bluesky at https://bsky.app/profile/gitwishes.bsky.social
This project uses AWS CDK (TypeScript) for infrastructure and a Python Lambda function for the bot logic. The bot:
- Daily Search: Searches GitHub commits from the previous day for messages containing "I wish", "I hope", etc.
- Storage: Stores filtered messages in DynamoDB with TTL
- Regular Posting: Posts the highest-scored message to Bluesky every 5 hours
- Node.js 18+
- Python 3.9+
- AWS CLI configured with appropriate permissions
- Bluesky account with app password
cd cdk
npm install
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
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
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'}, {})
"
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
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
BLUESKY_USERNAME
: Your Bluesky handleBLUESKY_PASSWORD
: Your Bluesky app passwordDB_TABLE_NAME
: DynamoDB table name (set by CDK)EXCLUDE_REPOS
: Comma-separated list of repos to ignore
Expected AWS costs: ~$1-2/month
- Lambda: ~100 free tier invocations
- DynamoDB: Pay-per-request (minimal)
- EventBridge: ~$1/month for rules