Skip to content
/ GitBot Public

GitBot is a tool designed to manage the lifecycle of changes in pull requests for GitOps providers like ArgoCD and FluxCD.

Notifications You must be signed in to change notification settings

mlophez/GitBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b8b0573 Β· Apr 5, 2025

History

25 Commits
Nov 29, 2024
Apr 5, 2025
Apr 5, 2025
May 20, 2024
Jun 4, 2024
Jun 6, 2024
May 18, 2024
Nov 29, 2024
Oct 9, 2024
Apr 5, 2025
Jun 6, 2024
May 27, 2024
May 20, 2024
May 20, 2024

Repository files navigation

GitOps Pull Request Bot

A Git provider-agnostic bot (Bitbucket, GitHub, etc.) designed to manage the lifecycle of pull requests for GitOps-based Kubernetes workflows using tools like Flux or ArgoCD.

✨ Key Features

  • PR event handling: open, update, merge, decline, and comment-based triggers.
  • Dynamic environment deployments via GitOps.
  • Preview environments before merging to main.
  • Works with Flux and ArgoCD.
  • Built in Go with vertical slicing architecture.

πŸ“¦ Use Case

When a pull request is opened on a GitOps repository, this bot listens for events but does not automatically deploy changes.

Instead, deployment actions are triggered explicitly by users through comments on the pull request.

πŸ” Supported Commands

  • #gitbot deploy <environment> Deploys the PR to the specified environment and locks all related apps to the PR branch. ❗ If the app is already locked by another PR, the deployment will be rejected.

  • #gitbot deploy <environment> <app-name> Same as above, but limits the deployment to the specified application.

  • #gitbot deploy-force <environment> Forces redeployment of all apps in the environment and takes over any existing lock, even if the app was previously deployed by another PR.

  • #gitbot deploy-force <environment> <app-name> Same as above, but targets a specific app and steals the lock if necessary.

  • #gitbot rollback <environment> Rolls back all apps in the specified environment to their previous state and removes any locks.

  • #gitbot rollback <environment> <app-name> Rolls back a specific app in the given environment and removes its lock.

These commands enable precise and flexible GitOps workflows. Locking ensures a single PR controls the lifecycle of each application in an environment. The deploy-force command should be used with caution, as it can override active locks.

πŸ”§ Supported Events

  • pull_request:open
  • pull_request:update
  • pull_request:merged
  • pull_request:declined
  • comment:deploy
  • comment:rollback
  • comment:deploy-force

πŸ“‚ Documentation

All usage details and capabilities are available in docs/.

πŸš€ Getting Started

# clone the repo
git clone https://github.com/yourorg/gitops-pr-bot.git

# build
go build -o gitops-pr-bot ./cmd

About

GitBot is a tool designed to manage the lifecycle of changes in pull requests for GitOps providers like ArgoCD and FluxCD.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages