Console #156 - Interview with Federico of Add & Commit - Automatically commit changes made in your workflow run directly to your repo
Featuring Background Remover, sudo-rs, and LibRedirect
🤝 Sponsor
This space is reserved for sponsors that support us to keep the newsletter going! Want to support Console? Send us a note at osh@codesee.io
🏗️ Projects
Browse through open source projects on OpenSourceHub.io, add your project to get more exposure and connect with other maintainers and contributors!
Background Remover
Remove Background from images and video using AI with a simple command line interface that is free and open source.
language: Python stars: 3103 last commit: 3 hours
repo: github.com/nadermx/backgroundremover
site: backgroundremoverai.com
sudo-rs
A memory safe implementation of sudo and su in Rust.
language: Rust stars: 1699 last commit: 4 days
repo: github.com/memorysafety/sudo-rs
LibRedirect
A web extension that redirects YouTube, Twitter, TikTok... requests to alternative privacy-friendly frontends and backends.
language: JavaScript stars: 2254 last commit: 2 days
repo: github.com/libredirect/browser_extension
site: libredirect.github.io
Add & Commit
You can use this GitHub Action to commit changes made in your workflow run directly to your repo: for example, you use it to lint your code, update documentation, commit updated builds, etc.
language: TypeScript stars: 818 last commit: 3 days
repo: github.com/EndBug/add-and-commit
Join thousands of other open-source enthusiasts and developers in the Open Source Hub Discord server to continue the discussion on the projects in this week's email!
🎙️ Interview With Federico of Add & Commit - Automatically commit changes made in your workflow run directly to your repo
Hey Federico! Thanks for joining us! Let us start with your background.
Hey folks, thanks for having me! 👋🏻 I’m a Computer Science Engineering student at Politecnico di Milano, in Milan, Italy. I’ve previously worked at Fabric, a US-based startup, to maintain some of their open source projects such as NPM packages and GitHub Actions.
I’m currently part of the GitHub Campus Experts program, which helps students organize events in their universities: I’m actively collaborating with the GitHub Education branch to improve different aspects of the program and some other initiatives like GitHub Graduation.
In a weird way, I feel like my gateway to coding was Minecraft: I used to really like messing around with redstone and command blocks, since as a kid I had always been obsessed with anything that worked automatically. When I discovered that you can code your own mods, I decided I wanted to learn how to code. Ironically, after that, I never even tried creating a Minecraft mod 😅
Why was Add and Commit started?
GitHub Actions had just been released in beta, so everything was pretty new: there were not a lot of docs, and there were very few community-created actions. I wanted to try lint the files in one of my other projects, so I started looking for a way to automatically commit the changes that I could make in a CI workflow.
I was able to find an action, stefanzweifel/git-auto-commit-action but, at the time, it was still using the “old” GitHub Actions specs: during the beta, they decided to rework the workflow syntax and the way inputs were handled, so the majority of (the few) existing actions were outdated.That’s what pushed me to create a new one: it was very small at first, but it gradually grew into a more complete solution.
Can you give us an overview of how Add and Commit works?
Using add-and-commit is pretty straightforward, you just need to add a step like this to your workflow:
- uses: EndBug/add-and-commit@v9
By default, everything in the current folder is added, and the user that triggered the workflow run is used as the author of the commit. If you want to change something in the action’s behavior, you can add some inputs:
- uses: EndBug/add-and-commit@v9 with: add: '*.js' default_author: github_actions message: Your custom commit message
There are a lot of available inputs that let you customize almost every aspect of the action, you may want to check out the project README for a complete list of available inputs. For behind the scenes overview, you can take a look at our Codebase Map.
What goes into creating a GitHub action?
I feel like as of now, GitHub has made it really easy to create your own action: you just have to get a bit familiar with the metadata and workflow syntax, and with GitHub’s REST API and its payload structures. All that stuff is well documented on GitHub’s Docs website, so if you want to create your own, you can just start from the “Creating actions” section!
What was the most surprising thing you learned while working on Add and Commit?
I guess that this project really made me realize the power of open source: I would have never expected my small project to be of any interest to anyone else, but after some time other people started opening issues and PR, and it’s also thanks to them that the action has reached this point.
How did the project get popular?
I think the main reason the project got popular is that some repos from Facebook, Microsoft, and Google started putting it in their workflows, and probably that gave it a lot more visibility to people that were just starting to use GitHub Actions. The fact that the action is designed to be a quick and easy way to use git probably made it even more useful to beginners, because they don’t need to deal with the whole git setup.
What is your typical approach to debugging issues filed in the Add and Commit repo?
I always ask for a link to the action run or, when not possible (e.g., the repo is private), the logs of the step that uses my action. This allows me to quickly see whether it’s an actual bug, or just some configuration error. If it’s an actual bug, I run the action with the same inputs in my test repo, enabling debug logging, so that I can see what causes the action to stop, if it’s not already clear. Then it’s just a matter of finding a solution that (hopefully 😅) doesn’t break the action for anybody else.
What is the release process like for Add and Commit?
Since this action is written in TypeScript, it needs to be compiled for it to be used and released. To make it easier to test changes, I’ve set up some git hooks using husky to help me keep the build up-to-date.
When I want to publish a new release, I bump the version using semantic versioning, and then I create a new release on GitHub. Along with the version tag, a CI workflow automatically updates the “latest” and major-version tag (“v9”, “v8”, …): I always suggest using the major-version tags because it allows users to get the non-breaking updates right away, reducing the number of times they have to bump the version in the workflow.
What advice would you give to new users who are just getting started with using GitHub Actions in their workflows?
Keep doing it! Once you start automating the repetitive and time-consuming tasks of your project, you realize how much more efficient using CI is. It’s worth it to spend a couple of hours on creating unit tests that run automatically, rather than wasting 10 times more running them manually.
How do you balance your work on open-source with your day job and other responsibilities?
It’s not always easy to balance work, study, and open-source development: I think that in this case it’s easier, since I’m the only person working on the project and so I don’t have any responsibilities towards other colleagues. I always try to prioritize projects with closer deadlines, and where more people are counting on me to do my job on time: that means that sometimes you have to set a personal project aside for some time, just to get back on it a couple of months later. But for now I’ve always been able to balance everything, one way or the other, and I hope I’ll keep being able to work on OSS in the future.
Are there any other projects besides Add and Commit that you’re working on?
Too many, probably 😅
EndBug/pages-preview is for sure one of those that really peaked my interest recently: it’s a GitHub action that allows you to deploy PR previews on GitHub Pages, as if you were using a third-party service like Vercel or Netlify, but without needing any paid plan.
Since you can’t have multiple GitHub Pages deployments at the same time, the workaround I found was pushing the static build of the website to different directories in a dedicated repo.
The project is still in its early stage, and there is a lot of room for improvement regarding concurrency and speed, but I really hope it turns out to be good in the end!
Want to join the conversation about one of the projects featured this week? Drop a comment, or see what others are saying!
Interested in sponsoring the newsletter or know of any cool projects or interesting developers you want us to interview? Reach out at osh@codesee.io or mention us @ConsoleWeekly!