WikiMovimentoBrasil / deadlinkchecker

GNU General Public License v3.0
3 stars 1 forks source link

Set a GitHub auto-updater #8

Closed albertoleoncio closed 9 months ago

albertoleoncio commented 9 months ago

Should be as simple as:

@app.route("/update-server", methods=["POST"])
def webhook():
    if request.method == "POST":
        subprocess.check_output(["git", "pull", "origin", "main"])
        return "Updated Toolforge project successfully", 200
    else:
        return "Wrong event type", 400

Source: https://wikitech.wikimedia.org/wiki/Help:Toolforge/Auto-update_a_tool_from_GitHub/GitLab#Python_tool_hosted_in_$HOME/www/python/src