承接 tei187/github-discord-webhook 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tei187/github-discord-webhook

最新稳定版本:v1.2.0

Composer 安装命令:

composer create-project tei187/github-discord-webhook

包简介

README 文档

README

This project implements a webhook integration between GitHub and Discord. It allows to handle multiple webhooks for different repositories and Discord channels, ran from the same script.

Features

  • Seamless integration between GitHub and Discord
  • Customizable notifications for different GitHub events
  • Easy setup and configuration

Setup

  1. Register a new webhook in your Discord server. You can find more information on how to do this here.
  2. Configure your webhook in the config\webhooks.php file.
    <?php
    
    return [
        // webhook name that will be used in payload URL in GitHub
        'sample-webhook' => [
            // Discord webhook URL
            'url' => 'https://discord.com/api/webhooks/(...)',
            // GitHub secret key
            'secret' => 'your-github-secret-key',
            // Array of repositories to filter through
            // May be left empty to listen to all repositories
            'repos' => [ 'username/repository-name' ],
        ]
    ];
  3. Set up rest of the config files (or if you want to run default, just remove the .example extensions).
  4. Register a new webhook in your GitHub repository. You can find more information about registering webhooks here.
    1. Enter your payload URL. If you have this package hosted i.e. under http://example.com/webhook, then the payload URL should be http://example.com/webhook/sample-webhook.
    2. Select "application/json" as the content type.
    3. Pick you secret and make sure to copy it somewhere, alternatively update the 'secret' key in config\webhooks.php.
    4. Alternatively pick which events you want to listen to.
  5. Believe it or not, that's it.

More settings

All configuration options are located in config directory. There you can set up classes for handlinng messages, payloads and webhooks. Also, there's a configuration file setting allowed events and actions.

Usage

Once set up, you'll receive notifications in your Discord server for events concerning:

  • Commits
  • Tags
  • Releases
  • Branches
  • Forks

Future plans include:

  • Pull requests
  • Issues
  • Comments
  • And more!

License

This project is licensed under the MIT License - see the LICENSE file for details.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-09-28