Skip to content

Conversation

@xingyaoww
Copy link
Contributor

🎯 Overview

This PR restructures the OpenHands GitHub Action repository into a clean, modular architecture with three independent GitHub Actions, removing redundant files and providing maximum flexibility for users.

🔄 Changes Made

Repository Restructuring

  • Removed root action.yml and scripts/ directory for cleaner structure
  • Created three self-contained GitHub Actions in subdirectories:
    • create-conversation/: Creates conversations and returns ID/URL immediately
    • poll-conversation/: Polls conversations and downloads trajectories
    • extract-message/: Extracts last agent message from trajectory files

Enhanced Functionality

  • Enhanced extract_last_message.py to work as both CLI utility and GitHub Action
  • Added GitHub Actions environment variable support for seamless integration
  • Supports multiple output formats (json, message-only, pretty)
  • Provides comprehensive outputs (message-file, action, message, timestamp)

Documentation & Testing

  • Updated README.md with new modular action structure and usage examples
  • Added comprehensive CHANGELOG.md with migration guide
  • Enhanced test workflows to demonstrate all three actions
  • Added artifact upload capabilities for trajectory files

📁 New Repository Structure

openhands-github-action/
├── create-conversation/
│   ├── action.yml                      # Create conversation action
│   └── create_conversation.py          # Stage 1 implementation
├── poll-conversation/
│   ├── action.yml                      # Poll conversation action
│   └── poll_conversation.py            # Stage 2 implementation
└── extract-message/
    ├── action.yml                      # Extract message action
    └── extract_last_message.py         # Message extraction (CLI + Action)

🚀 Available Actions

Action Path Description
Create Conversation All-Hands-AI/openhands-github-action/create-conversation@v2 Creates conversations and returns ID/URL
Poll Conversation All-Hands-AI/openhands-github-action/poll-conversation@v2 Polls conversations and downloads trajectories
Extract Message All-Hands-AI/openhands-github-action/extract-message@v2 Extracts last agent message from trajectory files

💡 Usage Example

# Complete three-stage workflow
- name: Create OpenHands conversation
  id: create
  uses: All-Hands-AI/openhands-github-action/create-conversation@v2
  with:
    prompt: "Review this code"
    openhands-api-key: ${{ secrets.OPENHANDS_API_KEY }}

- name: Poll conversation and download trajectory
  id: poll
  uses: All-Hands-AI/openhands-github-action/poll-conversation@v2
  with:
    conversation-id: ${{ steps.create.outputs.conversation-id }}
    openhands-api-key: ${{ secrets.OPENHANDS_API_KEY }}

- name: Extract final agent message
  uses: All-Hands-AI/openhands-github-action/extract-message@v2
  with:
    trajectory-file: ${{ steps.poll.outputs.trajectory-file }}
    format: "pretty"

Benefits

  1. Modularity: Users can use individual actions as needed
  2. Flexibility: Mix and match actions for custom workflows
  3. Clean Structure: No redundant files or backward compatibility baggage
  4. Enhanced Functionality: New extract-message action for processing results
  5. Better Organization: Clear separation of concerns

🧪 Testing

  • ✅ All YAML files validated for syntax correctness
  • ✅ Python scripts compile successfully
  • ✅ Extract functionality tested with sample trajectory data
  • ✅ Both CLI and GitHub Action modes verified
  • ✅ Test workflows updated to demonstrate new structure

📋 Breaking Changes

  • Removed root action.yml - users must now use specific action paths
  • Removed scripts/ directory - functionality moved to action subdirectories
  • No backward compatibility - this is a clean slate approach for v2

This restructuring provides a much cleaner, more maintainable codebase while giving users maximum flexibility to use exactly the functionality they need.

@xingyaoww can click here to continue refining the PR

- Remove root action.yml and scripts/ directory for cleaner structure
- Create three independent GitHub Actions in subdirectories:
  - create-conversation/: Creates conversations and returns ID/URL
  - poll-conversation/: Polls conversations and downloads trajectories
  - extract-message/: Extracts last agent message from trajectory files
- Each action is self-contained with its own action.yml and Python script
- Enhanced extract_last_message.py to work as both CLI utility and GitHub Action
- Updated documentation and test workflows for new modular structure
- Added comprehensive CHANGELOG.md with usage examples

This provides maximum flexibility allowing users to use individual actions
as needed while maintaining a clean, focused repository structure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants