- Can I use this package directly in a Laravel project, or is it just a standalone CLI tool?
- This is a standalone CLI tool, not a Laravel package, but it can be integrated into Laravel projects. You can call it via Artisan commands, shell scripts, or CI/CD pipelines. For example, create a custom Artisan command to wrap the `actions-watcher` CLI for seamless workflow monitoring within Laravel.
- How do I install and run this tool in a Laravel project?
- Install it globally with `composer global require spatie/github-actions-watcher`, then run `actions-watcher` in your Laravel project’s directory. For Laravel-specific integration, use Symfony’s `Process` component in an Artisan command to execute the tool programmatically, like `Process::run(['vendor/bin/actions-watcher'])`.
- Does this tool support monitoring workflows for private GitHub repositories?
- Yes, it requires GitHub authentication for private repos. Configure your GitHub personal access token (with `repo` scope) in the tool’s config file or pass it via `--token` flag. Store the token securely in Laravel’s `.env` file if integrating via Artisan commands.
- What Laravel versions does this package officially support?
- This tool is Laravel-agnostic, but it can be used with any Laravel version (5.5+). Since it’s a CLI, compatibility depends on your PHP version (8.0+ recommended). Test it in your Laravel project’s environment to ensure smooth integration with Artisan or shell scripts.
- How often does the tool poll GitHub for workflow updates, and can I adjust the frequency?
- By default, it polls every few seconds until all workflows complete. You can adjust the polling interval via the `--poll` flag (e.g., `--poll 10` for 10-second intervals). For production use, consider throttling to avoid hitting GitHub’s API rate limits.
- Can I parse the tool’s output programmatically in Laravel for logging or alerts?
- Yes, the tool outputs structured terminal data. Use PHP’s `exec()` or Symfony’s `Process` to capture output, then parse it with regex or JSON decoding. For alerts, pipe the output to Laravel’s notification system (e.g., Slack via `spatie/laravel-notification-channels-slack`).
- What are the alternatives to this tool for monitoring GitHub Actions in Laravel?
- Alternatives include GitHub’s native CLI (`gh`), `octokit/php` (for custom API calls), or `spatie/laravel-github` (a Laravel wrapper for GitHub API). For real-time updates, consider GitHub Actions Webhooks instead of polling. Choose based on whether you need CLI simplicity or deeper Laravel integration.
- How do I handle authentication securely if integrating this tool into Laravel?
- Store GitHub tokens in Laravel’s `.env` (e.g., `GITHUB_TOKEN=your_token`). Pass the token to the CLI via environment variables or config files. Avoid hardcoding tokens in scripts. For added security, use Laravel’s `Vault` or encrypted config files if managing sensitive credentials.
- Will this tool work in a CI/CD pipeline (e.g., GitHub Actions itself) for Laravel projects?
- Yes, you can use it in CI/CD pipelines by adding it as a step in your workflow file. For example, run `actions-watcher` after deployment to validate workflows. Ensure the GitHub token has the necessary permissions and is securely passed to the step.
- Does this tool support monitoring workflows across multiple repositories simultaneously?
- No, it defaults to the current directory’s repository. To monitor multiple repos, run the tool in separate terminal sessions or script multiple invocations. For Laravel, you could create a queue job to trigger the tool for each repo, but this requires custom logic to manage tokens and outputs.