spatie/github-actions-watcher
Monitor all GitHub Actions workflows for a repo in real time from your terminal. Install via Composer and run actions-watcher to auto-detect the current git repo/branch, poll status, and refresh until all runs complete. Auth required for private repos.
exec() or shell commands) to provide developer-facing visibility into workflow statuses.php artisan actions:watch) to monitor workflows for a Laravel repo..env or Vault). Risk of token leakage if not handled carefully.composer update. No Laravel-specific dependency resolution.octokit/php (GitHub API client for Laravel).spatie/laravel-github (Laravel wrapper for GitHub API).gh command).php artisan actions:watch command for local workflow monitoring.post-deploy scripts to verify workflows before promoting releases.spatie/laravel-notification-channels-slack).composer require spatie/github-actions-watcher
// app/Console/Commands/WatchActions.php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;
class WatchActions extends Command
{
protected $signature = 'actions:watch {--repo= : Target repo (default: current dir)}';
protected $description = 'Watch GitHub Actions workflows in real-time';
public function handle()
{
$process = new Process(['vendor/bin/actions-watcher', '--repo=' . $this->option('repo')]);
$process->run();
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
$this->output->write($process->getOutput());
}
}
app/Console/Kernel.php.app/Console/Kernel.php):
$schedule->command('actions:watch --repo=laravel-app')->daily();
git push).repo scope.workflow_runs DB table).composer update spatie/github-actions-watcher)..env or a secrets manager).storage/logs or a dedicated table.actions-watcher --help or stderr output.--poll-interval=30).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| GitHub API downtime | No workflow data | Fallback to cached data or manual checks. |
| Rate limit exceeded | Incomplete workflow data | Implement exponential backoff or use Webhooks. |
| Invalid GitHub token | Authentication failures | Use Laravel’s .env with GITHUB_TOKEN. |
| CLI process crashes | Silent failure | Wrap in Laravel’s try/catch and log errors. |
| Network issues (e.g., proxy) | Timeouts | Configure GitHub CLI proxy settings. |
| Laravel command registration error | Command unavailable | Verify app/Console/Kernel.php registration. |
How can I help you explore Laravel packages today?