Ashen Chathuranga's GitHub Action Delivers Version-Numbering Automation for Arduino Library Devs
Open source tool delivers version validation and automatic pull request merging, taking some of the drudgery out of library maintenance.
Developer and self-described "microcontroller enthusiast" Ashen Chathuranga has released a tool that aims to make it easier to maintain an Arduino library — by automatically validating, merging, and creating releases from pull requests using GitHub Actions.
"What this action does is pretty simple but valuable: when you create a pull request to the main branch, it checks the version in your library.properties file," Chathuranga explains. "If the version is different from the current one, it merges the pull request and creates a new release with the updated version tag. I often ran into issues where I'd forget to update the version number in library.properties, and it would create a mess, so I decided to create this action to automate the process."
Chathuranga's tool takes advantage of a feature of Microsoft's GitHub distributed coding and version control platform known as GitHub Actions, which allow scripts to be triggered on specific activity in a repository. In this case, a valid update submitted as a pull request is checked for a valid version number — ensuring that the number has been incremented since the last release, and that it follows valid semantic versioning rules — and automatically merged and released.
While deployment of Chathuranga's GitHub Action script should be done with care — in particular to ensure that it doesn't go ahead and start automatically merging and releasing pull requests from malicious third parties — it can serve as a starting point for taking some of the drudgery out of library maintenance, and to prevent the release of invalid version numbers that would lead to end-user confusion.
The action is now available to view and use on GitHub Marketplace, under the permissive MIT license, with more information in Chathuranga's Reddit post.