π€ Bot Commands Guide
Control your gem-ci workflows interactively through GitHub comments
π― Overview
gem-ci includes an interactive bot system that allows you to control workflows through GitHub issue and PR comments. Commands are triggered by commenting with /gem-ci
followed by specific actions.
π Available Commands
Help Command
Get list of available commands:
1
/gem-ci help
Response: Bot will reply with all available commands and their usage.
Release Management
Revise Release Type
Change the type of the next release:
1
/gem-ci revise release [from] to [to]
Examples:
1
2
3
/gem-ci revise release minor to patch
/gem-ci revise release major to minor
/gem-ci revise release patch to minor
Supported Release Types:
patch
- Bug fixes (1.0.0 β 1.0.1)minor
- New features (1.0.0 β 1.1.0)major
- Breaking changes (1.0.0 β 2.0.0)
Cancel Release
Cancel the current release PR:
1
/gem-ci cancel release
Effect: Closes the current release-please PR and prevents automatic release.
Workflow Control
Trigger CI (Coming Soon)
Manually trigger CI workflows:
1
2
3
/gem-ci run ci
/gem-ci run security
/gem-ci run quality
Skip CI (Coming Soon)
Skip specific CI checks:
1
2
/gem-ci skip ci
/gem-ci skip linting
π Usage Examples
Scenario 1: Downgrade Release Type
You created a feature but realized itβs just a bug fix:
1
2
3
4
5
# In PR or issue comment
/gem-ci revise release minor to patch
# Bot responds with:
β
Release type changed from minor to patch for the next release
Scenario 2: Emergency Release Cancellation
You need to stop a release thatβs in progress:
1
2
3
4
5
# In release PR comment
/gem-ci cancel release
# Bot responds with:
π Release cancelled. The release PR will be closed.
Scenario 3: Get Available Commands
Not sure what commands are available:
1
2
3
4
# In any issue or PR
/gem-ci help
# Bot responds with full command list
π§ Command Syntax
General Format
1
/gem-ci <command> [arguments]
Rules:
- Commands are case-insensitive
- Must start with
/gem-ci
- Can be anywhere in a comment
- One command per comment
- Supports emoji reactions for acknowledgment
Argument Patterns
Release Type Changes:
1
/gem-ci revise release <current-type> to <new-type>
Simple Commands:
1
/gem-ci <action>
π Bot Responses
Success Responses
Bot indicates successful command execution:
1
2
3
4
β
Command executed successfully
π Workflow triggered
π Configuration updated
π― Release type changed
Error Responses
Bot provides helpful error messages:
1
2
3
4
β Invalid command syntax
β οΈ Command not recognized
π« Insufficient permissions
π Missing required arguments
Help Responses
Bot provides detailed help:
1
2
3
4
5
6
7
8
9
10
π€ **gem-ci Bot Commands**
**Release Management:**
β’ `/gem-ci revise release [from] to [to]` - Change release type
β’ `/gem-ci cancel release` - Cancel current release
**General:**
β’ `/gem-ci help` - Show this help message
*Commands are case-insensitive and can be used in any issue or PR comment.*
π Permissions & Security
Who Can Use Commands
- Repository collaborators with write access
- PR authors for their own PRs
- Issue authors for their own issues
- Repository admins for all commands
Security Features
- Permission checking: Validates user permissions before execution
- Audit logging: All commands are logged in workflow runs
- Rate limiting: Prevents command spam
- Validation: Input validation prevents malicious commands
π οΈ Implementation Details
Workflow Integration
Commands are processed by .github/workflows/09-bot-commands.yml
:
1
2
3
4
5
6
7
8
9
10
11
12
13
name: 09 - Bot Commands
on:
issue_comment:
types: [created]
jobs:
process-command:
if: contains(github.event.comment.body, '/gem-ci')
runs-on: ubuntu-latest
steps:
- name: Process bot command
uses: actions/github-script@v7
# ... command processing logic
Command Processing
- Trigger Detection: Comment contains
/gem-ci
- Permission Check: Validate user has required permissions
- Command Parsing: Extract command and arguments
- Action Execution: Execute the requested action
- Response: Reply with success/error message
- Audit: Log command execution
π¨ Customization
Adding New Commands
Extend the bot with custom commands:
1
2
3
4
5
6
7
8
9
10
11
12
// In .github/workflows/09-bot-commands.yml
const customCommands = {
'deploy': async (args) => {
// Custom deployment logic
return 'π Deployment triggered';
},
'benchmark': async (args) => {
// Custom benchmark logic
return 'π Benchmark started';
}
};
Custom Response Messages
Customize bot responses:
1
2
3
4
5
6
const responses = {
success: 'β
Command executed successfully',
error: 'β Command failed',
unauthorized: 'π« You don\'t have permission for this command',
help: generateHelpMessage()
};
π Command Analytics
Usage Tracking
Monitor command usage through workflow runs:
- Most used commands: Track popular bot features
- Error rates: Monitor command success rates
- User adoption: See whoβs using bot commands
- Performance: Track command execution times
Metrics Available
1
2
3
4
5
6
# Tracked automatically in workflow runs
command_type: "revise_release"
user: "username"
execution_time: "2.3s"
success: true
repository: "owner/repo"
π¨ Troubleshooting
Common Issues
Command not recognized:
1
2
β Unknown command: '/gem-ci invalid'
π‘ Try '/gem-ci help' for available commands
Solution: Check command spelling and available commands.
Permission denied:
1
π« You don't have permission to execute this command
Solution: Ensure you have write access to the repository.
Command failed:
1
β Failed to revise release: No release PR found
Solution: Ensure thereβs an active release PR to modify.
Debug Information
Enable debug mode for troubleshooting:
1
2
# Add to any command for verbose output
/gem-ci help --debug
π Integration with Workflows
Release Workflow Integration
Bot commands integrate with release-please:
1
2
3
4
# .github/workflows/06-release.yml
- name: Check for bot commands
if: contains(github.event.comment.body, '/gem-ci revise release')
# ... release modification logic
CI Workflow Integration
Commands can trigger CI workflows:
1
2
3
4
# .github/workflows/02-ci.yml
- name: Manual CI trigger
if: contains(github.event.comment.body, '/gem-ci run ci')
# ... CI execution logic
π‘ Best Practices
Command Usage
- Clear intent: Use commands for specific, well-defined actions
- Documentation: Comment why youβre using a command
- Testing: Test commands in development branches first
- Permissions: Ensure team knows who can use commands
Command Design
- Intuitive syntax: Make commands easy to remember
- Helpful errors: Provide clear error messages
- Confirmation: Confirm destructive actions
- Logging: Log all command executions
π Future Enhancements
Planned Features
- Workflow control: Start/stop specific workflows
- Configuration updates: Modify workflow settings via commands
- Batch operations: Execute multiple commands together
- Scheduled commands: Schedule commands for later execution
- Command templates: Save commonly used command combinations
Advanced Features
- Natural language: Accept more natural command syntax
- Context awareness: Commands adapt based on PR/issue context
- Integration hooks: Connect with external services
- Command history: Track and repeat previous commands
Ready to use bot commands? Start with /gem-ci help
in any issue or PR comment to see whatβs available!