| description | argument-hint | |
|---|---|---|
Automatically fix CI issues, push, and monitor GitHub Actions |
|
I'll automatically fix all CI issues and monitor the GitHub Actions workflow until it passes.
!echo "π Checking current git status..." !git status --short !git fetch origin
!echo "π§ͺ Running local linting..." !make lint 2>&1
If linting fails, I'll fix common issues:
- Unchecked errors β Add proper error handling or exclusions in .golangci.yml
- Deprecated APIs (ioutil β os, types.Container β types.Container with exclusions)
- File permissions (0644 β 0600)
- Unused code removal
- Style issues (nil checks, fmt.Sprintf)
!echo "π§ͺ Running local tests..." !make test 2>&1
If tests fail, I'll analyze and fix:
-
Minor fixes (auto-fixable):
- Environment dependencies β Use t.TempDir() instead of /opt/ontree/apps
- Mock/stub issues β Remove unused types
- Go version compatibility β Use backward-compatible types
- Add skip conditions for Docker-dependent tests
-
Major issues (need human review):
- Logic errors in business code
- Architectural changes needed
- Security validation failures
- API contract changes
!echo "β Running final verification..." !make lint && make test
If everything passes locally, I'll commit the fixes:
!git add -A !git diff --staged --stat
$ARGUMENTS
Creating commit with message: "${1:-fix: make CI happy - auto-fixed linting and test issues}"
!git commit -m "${1:-fix: make CI happy - auto-fixed linting and test issues
- Fixed linting issues (errcheck, deprecated APIs, permissions)
- Fixed environment-dependent tests
- Ensured Go 1.21/1.22/1.23 compatibility
- All tests and linting pass locally
π€ Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com"
!echo "π€ Pushing to origin..." !git push origin main
!echo "π Monitoring GitHub Actions workflow..."
!which gh > /dev/null 2>&1 || echo "
If GitHub CLI is available, I'll monitor the workflow:
!if command -v gh &> /dev/null; then
echo "Getting latest workflow run...";
gh run list --repo stefanmunz/treeos --limit 1 --json databaseId,status,conclusion,name,headBranch 2>/dev/null || echo "Note: gh auth login may be required";
echo "Watching workflow (this will update every 10 seconds)...";
timeout 300 gh run watch --repo stefanmunz/treeos --interval 10 2>/dev/null || true;
echo "Getting final status...";
gh run list --repo stefanmunz/treeos --limit 1 --json status,conclusion 2>/dev/null | jq -r '.[0] | "Status: (.status), Conclusion: (.conclusion)"' || echo "Check https://github.com/stefanmunz/treeos/actions";
else
echo "π Check CI status manually at: https://github.com/stefanmunz/treeos/actions";
fi
Based on the CI results:
- β SUCCESS: CI is happy! All checks passed.
- β FAILURE: CI still failing. Checking logs for details:
!if command -v gh &> /dev/null; then
gh run view --repo stefanmunz/treeos --log-failed 2>/dev/null || echo "View logs at: https://github.com/stefanmunz/treeos/actions";
else
echo "View failure details at: https://github.com/stefanmunz/treeos/actions";
fi
If CI fails after our fixes, it might be due to:
- Cache issues - The CI cache might need clearing
- Environment differences - CI has different dependencies/versions
- Permissions - GitHub Actions might have different file permissions
- Network issues - Temporary GitHub/dependency failures
I've automatically:
- Fixed all linting issues found
- Fixed all test failures that could be auto-fixed
- Verified everything passes locally
- Committed and pushed the changes
- Monitored the CI pipeline
Human intervention needed for:
- Major test logic changes
- Security policy violations
- Architectural refactoring
- API breaking changes