Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbtechdev committed Dec 17, 2024
1 parent f288c1d commit 275133a
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 124 deletions.
21 changes: 1 addition & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ serde_json = "1.0.133"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
dotenv = "0.15.0"
hmac = "0.12.1"
sha2 = "0.10.8"
anyhow = "1.0.94"
octocrab = "0.42.1" # GitHub API client
twitter-v2 = "0.1.8" # X (Twitter) API v2 client
hex = "0.4.3" # For hex encoding/decoding
chrono = { version = "0.4.39", features = ["serde"] } # Date and time library
octocrab = "0.42.1"
twitter-v2 = "0.1.8"
chrono = { version = "0.4.39", features = ["serde"] }
97 changes: 0 additions & 97 deletions README-DMB.md

This file was deleted.

52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ We need an X bot that posts updates to `@deltaml_org` with information from GitH
### We need (for now) two types of posts:

#### 1. For new contributors:

```
Delta got a new contributor [Contributor Name]!
Expand All @@ -35,10 +36,59 @@ New release ([Version Number]) of Delta out! 🎉
Link to release notes: [Release link]
```

Implement these features in the bot, ensuring the messages are posted automatically whenever these events occur.
Implement these features in the bot, ensuring the messages are posted automatically whenever these events occur.

---



## Setup

1. Clone the repository
2. Set up environment variables:
- `GITHUB_TOKEN`: GitHub API token
- `X_API_KEY`: X (Twitter) API key
- `X_API_SECRET`: X (Twitter) API secret
- `X_ACCESS_TOKEN`: X (Twitter) access token
- `X_ACCESS_SECRET`: X (Twitter) access token secret
- `REPO_OWNER`: The owner of the GitHub repository
- `REPO_NAME`: The name of the GitHub repository

## Github Token Setup

1. Go to your GitHub account settings
2. Navigate to Developer settings > Personal access tokens
3. Generate a new token (classic) with the `repo` and `admin:repo_hook` scopes

## Github Repo Webhook Setup

1. Go to your GitHub repository settings
2. Navigate to Webhooks > Add webhook
3. Enter the webhook URL from the environment variable `WEBHOOK_PATH`
4. Select the events, "Push" and "Releases" you want to trigger the webhook

## Webhooks

* **Definition** : Webhooks are HTTP callbacks that allow one application to send real-time data to another whenever a specific event occurs.
* **Communication** : They use a request-response model. When an event occurs, the source application makes an HTTP POST request to a predefined URL (the webhook endpoint) on the target application, sending data about the event.
* **Use Case** : Commonly used for event-driven architectures where you want to notify another service about events, such as GitHub sending a notification about a new commit or release.
* **Example** : When a new issue is created in a GitHub repository, GitHub can send a webhook notification to your application to inform it of the new issue.

## X api Setup

Get these from the X Developer Portal (https://developer.twitter.com/en/portal/dashboard)

1. Go to your X (Twitter) dashboard
2. Navigate to your API keys
3. Create a new API key

---



If anything is unclear, reach out in the [Github Discussions](https://github.com/orgs/delta-rs/discussions/categories/general) here on GitHub.


## Contributors

The following contributors have either helped to start this project, have contributed
Expand Down

0 comments on commit 275133a

Please sign in to comment.