Skip to content

Conversation

@rajbos
Copy link
Contributor

@rajbos rajbos commented Dec 1, 2025

Problem

When using the action externally (e.g., devops-actions/github-copilot-pr-analysis@v0.0.1), the root action failed with:

Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/rajbos/rajbos/analyze'. 
Did you forget to run actions/checkout before running your local action?

This happened because the root action.yml was trying to call sub-actions using relative paths (./analyze and ./charts), which don't work when the action is consumed externally.

Solution

Updated the root action.yml to run the npm commands directly instead of calling sub-actions via relative paths. This follows the standard GitHub Actions pattern where:

  • Root action is self-contained with full implementation
  • Sub-actions remain available for modular usage via direct reference

Changes

  • ✅ Root action now includes: Node.js setup, dependency installation, analysis, and chart generation
  • ✅ Sub-actions (analyze/ and charts/) remain unchanged and usable independently
  • ✅ Fixes external usage of the action

Usage Patterns

All three usage patterns now work correctly:

1. Full Action (Analysis + Charts)

uses: devops-actions/github-copilot-pr-analysis@v0.0.1

2. Analysis Only

uses: devops-actions/github-copilot-pr-analysis/analyze@v0.0.1

3. Charts Only

uses: devops-actions/github-copilot-pr-analysis/charts@v0.0.1

Testing

Tested with rajbos/rajbos#77 which was failing with the error above.

Related

- Change from calling sub-actions with relative paths to running npm commands directly
- Fixes error when action is used externally: 'Can't find action.yml under ./analyze'
- Root action now contains full implementation (Node.js setup, npm ci, analyze, charts)
- Sub-actions (analyze/ and charts/) remain available for modular usage via direct reference

This follows the standard GitHub Actions pattern where:
- Root action is self-contained and can be used externally
- Sub-actions can still be called independently as:
  - devops-actions/github-copilot-pr-analysis/analyze@version
  - devops-actions/github-copilot-pr-analysis/charts@version
@rajbos rajbos merged commit a5b4304 into main Dec 1, 2025
2 checks passed
@rajbos rajbos deleted the fix/composite-action-paths branch December 1, 2025 21:59
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