Automating Project Maintenance on Github
Tags: github, bots, automation
Published: 2021-05-12 07:25:46

---
canonical_url: https://www.ravsam.in/blog/automating-project-maintenance-on-github/
date: 2021-05-11 08:34:30 UTC
published: true
tags: github,bots,automation
title: Automating Project Maintenance on Github
---

#### Know about the Maintenance stack we use at RavSam to keep our projects updated and secure.

> This blog was originally published on [RavSam’s blog](https://www.ravsam.in/blog/automating-project-maintenance-on-github/). We publish our articles on Medium after a week.

#### Contents

- Manual Maintenance is tough and boring
- Renovate  —  Automated Dependency Updates
- Imgbot  —  Automated Image Optimization
- RavSam Bot  —  A Github Probot App

#### Manual Maintenance is tough and boring

Most of the effort in the software business goes into the maintenance of the code that already exists. Once the software is built, many factors affect its performance over time. We need to fix bugs, address security vulnerabilities, make performance improvements, and decrease technical debt.

Managing a single piece of software is easy but as a developer, we often have to deal with more than one. And this is exactly where maintenance gets hard. The best way to handle **Maintenance debt** is to upgrade the dependencies on which our project depends regularly.

All these problems can be solved by automation. We at RavSam use [Github](http://github.com/ravsamhq) for our code handling and CI/CD purposes. There are tools like Github Apps and Github Actions that allow us to automate our software maintenance.

#### Renovate  —  Automated Dependency Updates

[Renovate](https://github.com/marketplace/renovate) is one of those packages that make our idea of automated maintenance a reality. It is a free, open-source, customizable Github app that helps us to automatically update our dependencies in software projects by receiving pull requests and that too for multiple languages.

![Dependency Updates by Renovate](https://cdn-images-1.medium.com/max/1024/0*kxVKEKvT3VfahIPZ.png)<figcaption>Dependency Updates by Renovate</figcaption>

The best part is that we can write a single config and use it for all of our projects in our Github organization. Here is a config that we use at RavSam:

```json
{
  "extends": ["config:base"],
  "labels": ["dependencies"],
  "major": {
    "enabled": false
  },
  "packageRules": [
    {
      "matchUpdateTypes": ["patch", "pin", "digest"],
      "automerge": true
    }
  ],
  "prCreation": "not-pending",
  "schedule": ["every weekend"],
  "stabilityDays": 3
}
```

We have configured Renovate to run only on weekends to prevent noise and distractions. We have enabled auto-merge when the update type is one of the following: _patch_, _pin_ or _digest_.

#### Imgbot  —  Automated Image Optimization

The performance of a Web App is often dependent on the images. Hence it is crucial to optimize images or else lose customers. Another advantage of optimized images is that it reduces the bandwidth costs for us as well as our visitors.

We love [Imgbot](https://github.com/marketplace/imgbot). It optimizes the images and creates a pull request against our default branch. Imgbot is verified by GitHub which means there is no point worrying about the security.

![Images optimized by ImgBot](https://cdn-images-1.medium.com/max/1024/0*8BzyH97kL4mfIv50.png)<figcaption>Images optimized by ImgBot</figcaption>

#### RavSam Bot  —  A Github Probot App

We have built our custom serverless Github Probot, [RavSam Bot](https://github.com/apps/ravsam-bot), our employee #1. It helps us automate various tasks like managing issues by raising their priority, assigning confirmed issues to developers, assigning reviewers to the pull requests, auto-merging them once the changes have been approved and many more things.

![Approved pull request merged by RavSam Bot](https://cdn-images-1.medium.com/max/1024/0*7ciVKnj5mrR-Cqdj.png)<figcaption>Approved pull request merged by RavSam Bot</figcaption>

Probot apps are easy to write, deploy, and share. We have deployed our app on Netlify Functions and it spends the entire day doing mundane tasks for us tirelessly.

If you loved my article, please clap 👏 for it.

#### Connect with Me

I love writing for the community while working on my freelance and open source projects. Connect with me through [Twitter](https://twitter.com/ravgeetdhillon) • [LinkedIn](https://linkedin.com/in/ravgeetdhillon) • [Github](https://github.com/ravgeetdhillon) • [Email](mailto:ravgeetdhillon@gmail.com).

#### About RavSam Web Solutions

We are helping startups and companies set up content management systems to manage their content delivery to customers across various products. Reach out to us to know more about our services, or anything else. We are always looking forward to work on great ideas. If you are looking for [an application development company](https://www.ravsam.in/), you are most welcome to get in touch with us.

#### You might also enjoy reading

- [Deploy a Serverless Probot/Github App on Netlify Functions](https://www.ravsam.in/blog/deploy-a-serverless-probot-github-app-on-netlify-functions/)

- [Deploy Strapi on VPS with Ubuntu, MySQL](https://www.ravsam.in/blog/deploy-strapi-on-vps-with-ubuntu-mysql/)

* * *