valgorithms/discord-changelog

GitHub commits -> Discord webhook watcher

Maintainers

Package info

github.com/Valgorithms/discord-changelog

pkg:composer/valgorithms/discord-changelog

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.0 2026-05-28 13:15 UTC

This package is auto-updated.

Last update: 2026-05-28 17:10:21 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.php is the project's bootstrap. It searches parent directories for a .env and ensures last_commit.txt exists; run it with php run.php.

Configuration

  • Environment variables are defined in .env (see .env.example).
    • DISCORD_WEBHOOK — your Discord webhook URL (don't leave as CHANGEME).
    • GITHUB_REPO_API — GitHub commits API URL.
    • LAST_COMMIT_FILE — file to store last seen commit SHA (defaults to last_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 phpacker build bundles a bootstrap (run.php) and the packaged binary expects to find a .env when executed; run.php searches upward from the current working directory so packaged binaries can locate the project .env.

Logging

  • The CLI uses Monolog and logs to php://stdout by default. To provide a custom logger, instantiate Valgorithms\DiscordChangelog\GitHubCommitWatcher directly and pass a PSR-3 LoggerInterface implementation.

Support

  • If you hit issues packaging or running the exe, ensure the build output contains the vendor/ folder or use run.php which is tolerant of layout.