| name | push-watch |
| description | Push current branch and monitor CI workflow until completion |
Push and Watch CI Workflow
Push the current branch to origin and monitor the triggered GitHub Actions workflow until it completes.
Steps
-
Push the current branch:
git push origin HEAD
-
Get the current branch name:
git branch --show-current
-
Wait briefly for workflow to trigger (2-3 seconds), then find the latest workflow run:
gh run list --branch <branch-name> -L 1 --json databaseId,status,conclusion,url,workflowName
-
Watch the workflow run until completion:
gh run watch <run-id>
-
Report the final status:
- If successful: Report success with the workflow URL
- If failed: Report failure and suggest running
/sonar-status or gh run view <id> --log-failed
Error Handling
- If push fails due to remote changes, suggest
git pull --rebase
- If no workflow is triggered within 10 seconds, check if GitHub Actions are enabled
- If workflow fails, provide the URL to view logs
Output Format
Report concisely:
- Push status
- Workflow name and run ID
- Final status (success/failure)
- URL to the workflow run