Skip to content

AuroraEditor/Aurora-Editor-Bot

Repository files navigation

Logo

Aurora Editor GitHub Webhook

Twitter Follow Discord


This is the repository for the Aurora Editor GitHub Webhook bot.
The bot is used to automate some tasks in the AuroraEditor organization.

Run

create a config.php file in the root directory with the following contents:

<?php
$settings = array(
    "username" => "my-bot-name",
    "admins" => array(
        "0xWDG",
        "my-bot-name"
    ),
    "github_token" => "GITHUB TOKEN",
    "discord_webhook" => "DISCORD WEBHOOK",
    "serverURL" => "Https url for debugging"
);

Note
Change all values to your own settins/values.

Run the webhook

Upload this to your server and serve it with PHP.

Tests

This section tells you how to test different payloads.

Note
Some payloads may not work in your environment.
if you have not the correct rights to AuroraEditor/Aurora-Editor-Bot.

Run all tests

sh test_all_payloads.sh

Run test (issue.json)

This simulates a new issue Aurora-Editor-Bot #24.

php index.php issue.json

Run test (please_assign_me.json)

This simulates a new comment in Aurora-Editor-Bot #24 saying @aurora-care-bear please assign me.

php index.php please_assign_me.json

Run test (pr.json)

This simulates a new PR Aurora-Editor-Bot #25.

php index.php pr.json

Run test (accept_pr.json)

This simulates a new comment in Aurora-Editor-Bot #25 from an admin saying @aurora-care-bear please accept this pr..

Warning
This will not execute if my-bot-name is not an admin.

php index.php accept_pr.json