Skip to content

nexoscreation/bot-github-template

Repository files navigation

🚀 GitHub Bot Template

Probot TypeScript License: MIT

Welcome to the GitHub Bot Template! 🤖
This repository provides a robust template for building your own GitHub bot using Probot and TypeScript. The bot automates common workflows like handling issues, pull requests, and notifications while being highly extensible.


🎯 Features

  • 📝 Issue Automation: Automatically triage issues with labels, comments, and assignments.
  • 🔍 Pull Request Workflow: Streamline code reviews with reviewer assignment, comments, and more.
  • 📣 Notifications: Notify contributors and maintainers about important events.
  • 🔧 Extensible and Modular: Easily add new functionality with a service-based architecture.
  • 🌟 TypeScript Support: Take advantage of type safety and modern JavaScript features.

🚀 Getting Started

Follow these steps to get your bot up and running:

1️⃣ Clone the Repository

git clone https://github.com/nexoscreation/bot-github-template.git
cd bot-github-template

2️⃣ Install Dependencies

npm install

3️⃣ Set Up Environment Variables

Create a .env file based on the provided .env.example:

APP_ID=your_app_id
PRIVATE_KEY=path_to_private_key.pem
WEBHOOK_SECRET=your_webhook_secret
GITHUB_TOKEN=your_personal_access_token

4️⃣ Run the Bot

npm start

5️⃣ Expose the Bot (Optional)

Use a tool like ngrok to expose your bot locally:

ngrok http 3000

🛠️ Development

🧪 Testing

Write unit and integration tests to ensure the bot works as expected:

  • Unit tests are located in test/unit/.
  • Integration tests are located in test/integration/.

Run tests with:

npm test

🛡️ Linting

Ensure code quality using ESLint:

npm run lint

🏗️ Build

Compile the TypeScript code to JavaScript:

npm run build

👥 Contributing

We 💖 contributions! If you'd like to contribute:

  1. Fork the repo and create your branch (git checkout -b feature/AmazingFeature).
  2. Commit your changes (git commit -m 'Add some AmazingFeature').
  3. Push to the branch (git push origin feature/AmazingFeature).
  4. Open a Pull Request.

For detailed guidelines, see CONTRIBUTING.md.


📜 License

This repository is licensed under the MIT License. See LICENSE.md for more information.


🌟 Support

  • Found this template helpful? Give us a ⭐ on GitHub!
  • Questions? Open an issue or join the discussion in Discussions.

💡 Acknowledgments

  • Thanks to the Probot team for their amazing framework.
  • Inspired by the open-source community.