valgorithms / discord-changelog
GitHub commits -> Discord webhook watcher
v1.1.0
2026-05-28 13:15 UTC
Requires
- php: >=7.4
- monolog/monolog: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- phpacker/phpacker: ^0.6.4
- phpunit/phpunit: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-28 20:52:42 UTC
README
Discord changelog webhook watcher
Small PSR-4 CLI that watches a GitHub repo's commits and posts new commits to a Discord webhook (skips commits that mention "Social SDK").
Quick start
- Install dependencies:
composer install
- Copy and edit environment variables:
cp .env.example .env
# Edit .env and set DISCORD_WEBHOOK and GITHUB_REPO_API
-- Run the CLI (from the project root):
# Preferred: run the bootstrap which locates .env
php run.php
Bootstrap helper
run.phpis the project's bootstrap. It prefers.envbeside the script, then searches the working directory and its parents, then the script's parents. It ensureslast_commit.txtexists; run it withphp /path/to/run.phpfrom any directory.
Configuration
- Environment variables are defined in
.env(see .env.example). Existing process,$_ENV, and$_SERVERvalues take precedence over the file. The file is required even when configuration is supplied by the environment. The loader acceptsKEY=valuelines, skips blank/comment/malformed lines, and strips one matching pair of surrounding quotes. It preserves embedded=and#characters; shell expansion, interpolation, and inline comments are not supported.DISCORD_WEBHOOK— your Discord webhook URL (don't leave asCHANGEME).GITHUB_REPO_API— GitHub commits API URL.LAST_COMMIT_FILE— file to store last seen commit SHA (defaults tolast_commit.txt).
Composer scripts
composer unit— run the test suite (phpunit).composer cs— run PHP CS Fixer.composer phpacker— build single-file binaries (non-interactive; platform baked into the script).
Testing
- Tests live under
tests/and use PHPUnit. Run:
composer unit
Packaging notes
- The
phpackerbuild bundles a bootstrap (run.php) and the packaged binary expects to find a.envwhen executed;run.phpsearches upward from the current working directory so packaged binaries can locate the project.env.
Logging
- The CLI uses Monolog and logs to
php://stdoutby default. To provide a custom logger, instantiateValgorithms\DiscordChangelog\GitHubCommitWatcherdirectly and pass a PSR-3LoggerInterfaceimplementation.
Support
- If you hit issues packaging or running the exe, ensure the build output
contains the
vendor/folder or userun.phpwhich is tolerant of layout.