Have you ever wanted to get a simple notification when there is a new Release for your favorite PowerShell Module or other Public Repo on GitHub? In this post we’ll talk about how you can use Power Automate to watch for new releases and trigger events on these and send out Teams messages, Emails, or even Kick off an Azure Function or similar automation.
In my previous post, we did some automation with client-side scripts and Microsoft Graph to update Outlook Auto-Responses on a schedule. Today we will be going in a different direction for something with almost no code in it at all - Power Automate.
Power Automate is an excellent tool that can monitor for changes, run actions on a schedule, process events, or just run a multi-step process when you hit a button. It does all of this with you having to write no, or minimal, code by using Service Connectors and abstracting out Events and Actions that you might need to take. This post assumes that you are somewhat familiar with Power Automate, for an introduction to Power Automate, check out this Microsoft Docs Article, or this Microsoft Learn Course on Automate.
However, when you look at the GitHub connector, it only supports a few triggers related to Issues and Pull Requests, and if we check the GitHub Connector triggers documentation, then even those would require an API key. Since these are public repos, instead of repos we own, we won’t have any way to get a API key anyway.
We definitely need some other direction.
GitHub supports Atom Feeds
After some searching around, I found that GitHub support Atom Feeds by appending
.atom to certain URLs.
From what I could find, these are supported on Releases, Tags, and Commits. To get the feed, simply take the URL for the feeds and append
strong>.atom/strong> to the end.
Releases · PowerShell HTML - https://github.com/PowerShell/PowerShell/releases ATOM - https://github.com/PowerShell/PowerShell/releases.atom
Tags · PowerShell HTML - https://github.com/PowerShell/PowerShell/tags ATOM - https://github.com/PowerShell/PowerShell/tags.atom
Commits · win-acme · Master Branch HTML - https://github.com/win-acme/win-acme/commits/master ATOM - https://github.com/win-acme/win-acme/commits/master.atom
Discovering & Testing RSS/Atom feeds
To test what the content of the feeds was, I used rssatom.com to check I had a valid Atom or RSS feed URL that worked publicly.
Now, armed with these feed URLs, we have… no connector for Atom Feeds directly… damn… we were so close…
But! Atom Feeds are mostly compatible with RSS Feeds. Compatible enough that we can actually use the RSS Feed connector to receive the feeds and throw our events! We just won’t be able to access all of the fields.
Connecting the Connectors
The useful fields available to us are below:
- Feed Entry Title
- Feed Entry Primary Link
- Feed Entry Links
- A list of the links in the entry
- Feed Entry Summary
- Roughly the “text” of the Feed Entry
- Feed Entry Update and Published Dates
Here is a full listing and link to the RSS Feed Connector documentation
So from here, we can use the RSS Feed trigger, build some variables, and send it to the Teams Connector. From this, I refined the formatting a bit, and ended up with this.
This sends through notifications to Teams that look like this:
You can download this here to import this into your own environment and start getting your own notifications from Public Repos.
You can also use this as a guide to set up alerts on any other RSS feeds or most Atom feeds as well. Since this is already in Power Automate, you could also use hundreds of different connectors to connect to other services like Azure Automation, DevOps, Blob Storage, FTP, Slack, Todoist, or even invoke a Web API.
In this post, we found a way to work around some limitations of the GitHub Connector, made a Power Automate flow that can be easily duplicated to subscribe to many feeds, and used Power Automate to post notifications to Teams Channels.What kind of workflows would you like to automate? Let me know what kind of things you are doing with Power Platform on the Discord below. For some ideas of automations you might be able to use, go Browse Power Automate Templates, Search Connectors, or check out the Power Automate Community.
If you have questions, are having problems, or just want to chat over something, for the best response you can reach me and several other IT Pros on the WinAdmins Discord as @PsychoData or you can reach me on Twitter.
Kevin Crouch Contributor