Skip to content

Conversation

@shashank-factory
Copy link

Summary

Add modular sub-actions (prepare/, review/, combine/) that enable parallel execution of code reviews in multi-job GitHub Actions workflows.

Changes

New Sub-Actions

  • prepare/action.yml - Initialize review, create tracking comment, detect review modes
  • review/action.yml - Run code review as standalone job
  • combine/action.yml - Combine results and post inline comments

New Entrypoints

  • src/entrypoints/get-token.ts - Get GitHub token via OIDC for sub-actions
  • src/entrypoints/generate-review-prompt.ts - Generate review prompt for standalone review action
  • src/entrypoints/generate-combine-prompt.ts - Generate combine prompt for result aggregation

Type Changes

  • Made commentId optional in create-prompt types to support sub-action usage
  • Added skipped and reason fields to PrepareResult for better flow control

Testing

  • All existing tests pass
  • Type checking passes

Usage

This enables workflows like:

jobs:
  prepare:
    steps:
      - uses: Factory-AI/droid-action/prepare@v1
        with:
          factory_api_key: ${{ secrets.FACTORY_API_KEY }}

  code-review:
    needs: prepare
    steps:
      - uses: Factory-AI/droid-action/review@v1
        with:
          factory_api_key: ${{ secrets.FACTORY_API_KEY }}
          tracking_comment_id: ${{ needs.prepare.outputs.comment_id }}

  combine:
    needs: [prepare, code-review]
    steps:
      - uses: Factory-AI/droid-action/combine@v1
        with:
          factory_api_key: ${{ secrets.FACTORY_API_KEY }}
          tracking_comment_id: ${{ needs.prepare.outputs.comment_id }}

Part of

This is PR 1 of 3 for the security review feature:

  1. This PR: Sub-action infrastructure
  2. PR 2: Code review refactor (output to JSON)
  3. PR 3: Security review feature

Add prepare/, review/, and combine/ sub-actions that enable parallel
execution of code reviews in multi-job workflows.

New files:
- prepare/action.yml - Initialize review, create tracking comment
- review/action.yml - Run code review as standalone job
- combine/action.yml - Combine results and post inline comments

New entrypoints:
- src/entrypoints/get-token.ts - Get GitHub token via OIDC
- src/entrypoints/generate-review-prompt.ts - Generate review prompt
- src/entrypoints/generate-combine-prompt.ts - Generate combine prompt

Type changes:
- Made commentId optional in create-prompt types
- Added skipped/reason fields to PrepareResult

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@factory-droid
Copy link
Contributor

factory-droid bot commented Jan 8, 2026

Droid finished @shashank-factory's task —— View job


Code Review Completed

No high-severity issues found

Summary

This PR introduces sub-action infrastructure for the Droid GitHub Action, splitting functionality into three composable actions (prepare/, review/, combine/) with dedicated TypeScript entrypoints.

Key Changes Reviewed

  • New composite actions in prepare/action.yml, review/action.yml, and combine/action.yml
  • New entrypoints: get-token.ts, generate-review-prompt.ts, generate-combine-prompt.ts
  • Type changes making droidCommentId and commentId optional throughout the prompt creation system
  • New combine-prompt.ts template for finalizing reviews

Files Changed

File Additions Deletions
combine/action.yml 71 0
prepare/action.yml 77 0
review/action.yml 83 0
src/entrypoints/generate-combine-prompt.ts 110 0
src/entrypoints/generate-review-prompt.ts 126 0
src/entrypoints/get-token.ts 40 0
src/create-prompt/templates/combine-prompt.ts 83 0
src/create-prompt/index.ts 10 15
src/create-prompt/types.ts 1 1
src/prepare/types.ts 2 0

Review Notes

  • Code patterns are consistent with existing codebase conventions
  • Type changes properly propagate the optional droidCommentId through the prompt creation system
  • New entrypoints follow established error handling patterns

View workflow run

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.

2 participants