Skip to content

πŸ€– :octocat: A GitHub bot that runs on issues, pull requests, and pull request comments

License

Notifications You must be signed in to change notification settings

guibranco/gstraccini-bot

Repository files navigation

GStraccini GitHub Bot

πŸ€– :octocat: A GitHub bot that runs on issues, pull requests, and comments.

Deploy via ftp PHP Linting JSON/YAML validation Shell checker


Installation

To install this bot, go to the GitHub apps page and install it in your account, organization, or repositories. The commands this bot can do are listed below, or you can always comment in a pull request with @gstraccini help to retrieve an updated list of commands, parameters, and descriptions.


Commands

That's what I can do :neckbeard::

  • @gstraccini help: Shows the help message with available commands.
  • @gstraccini hello: Says hello to the invoker.
  • @gstraccini thank you: Replies with you are welcome message to the invoker.
  • @gstraccini appveyor build <type>: Runs the AppVeyor build for the target commit and/or pull request.
    • type: [required] Specifies if it should trigger a build in a commit or pull request.
  • @gstraccini appveyor register: Registers the repository in AppVeyor.
  • @gstraccini appveyor reset: Resets the AppVeyor build number for the target repository.
  • @gstraccini bump version <version> <project>: Bumps the .NET version in .csproj files.
    • version: [required] The .NET version
    • project: [optional] The .csproj file to update. Suppressing this parameter will run the command in all .csproj in the repository/branch.
  • @gstraccini change runner <runner> <workflow> <jobs>: Changes the GitHub action runner in a workflow file (.yml).
    • runner: [required] The runner's name
    • workflow: [required] The workflow filename (with or without the .yml/.yaml extension).
    • jobs: [optional] The jobs to apply this command. Suppressing this parameter will run the command in all jobs within the workflow.
  • @gstraccini csharpier: Formats the C# code using CSharpier (only for .NET projects).
  • @gstraccini fix csproj: Updates the .csproj file with the packages.config version of NuGet packages (only for .NET Framework projects).
  • @gstraccini prettier: Formats the code using Prettier.
  • @gstraccini review: Enable review for the target pull request. This is useful when the PR submitter wasn't on the watch list, the webhook was not captured, or some failed scenario occurred.
  • @gstraccini track: Tracks the specified pull request. Queue a build, raise a dependabot recreate comment to resolve conflicts, and synchronize merge branches.
  • @gstraccini update snapshot: Update test snapshots (npm test -- -u) (only for Node.js projects).

Multiple commands can be issued at the same time. Just respect each command pattern (with bot name prefix + command).

Warning

If you aren't allowed to use this bot, a reaction with a thumbs down will be added to your comment.


How it works

This project is just part of the overall process. Currently, another (still private) repository works with this one to provide all the necessary data and metadata for the actions.


Webhooks

Once you install the GStraccini-bot GitHub app, GitHub will start sending webhooks to a registered endpoint for some events. Once these webhooks reach the handler, they are stored in SQL database tables to be processed later by this bot.

If you are interested in hosting your own instance, let me know, and I will share the database schemas and scripts and the procedure for creating your own GitHub app to receive events on your infrastructure.


Cronjobs

The bot handlers on this repository run on my own infrastructure with the following intervals:

  • GStraccini Bot - Branches - πŸ• every 1 minute
  • GStraccini Bot - Comments - πŸ• every 1 minute
  • GStraccini Bot - Issues - πŸ• every 1 minute
  • GStraccini Bot - Pull Requests - πŸ• every 1 minute
  • GStraccini Bot - Pushes - πŸ• every 1 minute
  • GStraccini Bot - Signature - πŸ• every 5 minutes