6

I want to show the commit activity on my repo hosted at GitHub using the RSS feeds. I am using the URL:

https://github.com/RiverDonkey/Drupal-Mailcheck/commits.atom

but the issue is this will result in commits only from the base branch (in this case master).

I want to fetch not only commits from master, but from all my branches. Is this possible?

random
  • 9,774
  • 10
  • 66
  • 83
MartinElvar
  • 5,695
  • 6
  • 39
  • 56

2 Answers2

3

You will need the RSS feeds for each of the branches you want to show commit activity on and merge them.

The RSS feed for your current default branch is as follows:

https://github.com/{username}/{repo-name}/commits.atom

For each of your other branches (including "master" if that's not your default branch view) they will follow the URL format of:

https://github.com/{username}/{repo-name}/commits/{branch-name}.atom

You can work out what branches exist in an repo by hitting the API with the following:

https://api.github.com/repos/{username}/{repo-name}/branches

The JSON response will list all the branches and the last commit made to each branch.

Do what you need to do to collect them all and poke them through a single filtered view.

random
  • 9,774
  • 10
  • 66
  • 83
  • I thought of this aswell, but the code is unaware of other branchens than the base branch, as far as i know, there is no way to tell the existen branchens in a repo. Am i wrong? – MartinElvar Sep 13 '12 at 05:27
  • Have added how you can dynamically grab a list of all the branches in the repo @mar – random Sep 13 '12 at 13:12
0

I created a Yahoo pipe to fetch all branches from a private repo via the Github API, then fetch all the commits from each branch, take unique ones and sort them oldest first, and publish as an RSS feed (my favorite RSS reader is Inoreader). Note that you need both an application token and the RSS token you can find in the source of your private repo homepage.

You can access it here: http://pipes.yahoo.com/dankohn/allgithubcommits

Click edit to see how it works.

Dan Kohn
  • 33,811
  • 9
  • 84
  • 100