How do I get notifications for commits to a repository?

前端 未结 8 1554
孤城傲影
孤城傲影 2021-02-05 02:04

I\'d like to know what kind of commits are being made to the Lithium framework so I can update (or rollback) when there is something major.

I\'m already watching the re

相关标签:
8条回答
  • 2021-02-05 02:25

    You go into Settings > Integrations & services for the GitHub repository and add an Email service. See Choosing the types of notifications you receive.

    0 讨论(0)
  • 2021-02-05 02:33

    I just found out by accident that you can easily manage to achieve this:

    • fork the project (if you haven't done it yet)
    • create a pull request for yourself from the selected branch, e.g. from master of head project to master of your fork:
      • base repository: your/project ; base: master <-- head repository: original/project ; compare: master
    • do NOT merge this pull request
    • under the Email section of your Notifications settings enable:
      • Comments on Issues and Pull Requests
      • Pull Request reviews
      • Pull Request pushes

    That's it. You will receive email notifications about every commit on master branch.

    0 讨论(0)
  • 2021-02-05 02:34

    You can use GitHub webhooks and set it up with a push notification API. This is free and easy to do.

    Spontit is an example of a free API that enables you to do this.

    For a tutorial, see this video.

    Written instructions are available in the README here.

    0 讨论(0)
  • 2021-02-05 02:36

    Disclaimer: I'm the original author.

    This project allows you to get an e-mail when a commit gets pushed on a repository you are watching (on any branch).

    Explaination: gicowa is a command-line tool written in python that lists all last commits on all GitHub repos you are watching. This tool can send its output via e-mail and can be called from your crontab. Doing that makes you receive an e-mail notification each time a commit gets pushed on a GitHub repo you are watching.

    0 讨论(0)
  • 2021-02-05 02:38

    Subscribe to Github's RSS feed!
    Choose your news feed (all watched repos), or only Lithium's commit history.

    RSS are made for that ;-)

    PS: I don't see how can you find that useful since there is a couple of commits made each day on various branches, some small typo fixes, others fix bugs, and others introduce new things...

    0 讨论(0)
  • 2021-02-05 02:42

    You can leverage the GitHub Events API to perform such task and retrieve a JSON formatted response.

    • syntax: GET /repos/:user/:repo/events
    • example: https://api.github.com/repos/UnionOfRAD/lithium/events

    Note: In order to retrieve the commits, you'll have to filter out the events of type PushEvents.

    Below a quick sample

    $(function() {
        $.getJSON('https://api.github.com/repos/UnionOfRAD/lithium/events?callback=?', function(data) {
            var list = $('#push-events');
    
            $.each(data.data, function(key, val) {
                if (val.type == "PushEvent") {
                    $.each(val.payload.commits, function(key2, val2) {
                        list.append('<li id="' + val2.sha + '"><a href="https://github.com/UnionOfRAD/lithium/commit/' + val2.sha + '">'
                                    + val2.message + '</a> [' + val.actor.login + ' @ ' + val.created_at + ']</li>');
                    });
                }
            });
            
            if (list.children().size() == 0) {
                list.append('<li>No pushes in last ' + data.data.length + ' events.</li>');
            }
        });
    });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <ul id="push-events"></ul>

    0 讨论(0)
提交回复
热议问题