Skip to content

fix(action): Resolve install sub-action path for external repos#704

Merged
BYK merged 1 commit intomasterfrom
fix/action-install-path-resolution
Jan 12, 2026
Merged

fix(action): Resolve install sub-action path for external repos#704
BYK merged 1 commit intomasterfrom
fix/action-install-path-resolution

Conversation

@BYK
Copy link
Member

@BYK BYK commented Jan 12, 2026

Problem

When external repositories (like sentry-capacitor) use getsentry/craft@v2, the composite action fails at the "Install Craft" step:

Can't find 'action.yml' under '/home/runner/work/sentry-capacitor/sentry-capacitor/install'

GitHub Actions incorrectly resolves the relative ./install path against the calling repository's checkout directory instead of the Craft action's directory.

Solution

Use two conditional steps that handle both scenarios:

  • Dogfooding (github.repository == 'getsentry/craft'): Uses ./install which works because the checkout is in the Craft repo
  • External repos: Uses getsentry/craft/install@${{ github.action_ref }} to fetch the sub-action from the Craft repository at the same ref (e.g., v2)

This also works correctly when external repos use the reusable workflow, since it internally uses getsentry/craft@v2.

When external repositories use the Craft action, GitHub Actions incorrectly
resolves the relative `./install` path against the calling repository's
checkout directory instead of the Craft action's directory.

This fix uses conditional steps:
- Dogfooding (getsentry/craft): Uses `./install` which works because the
  checkout is in the Craft repo
- External repos: Uses `getsentry/craft/install@${{ github.action_ref }}`
  to fetch the sub-action from the Craft repository at the same ref
@github-actions
Copy link
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

  • (action) Resolve install sub-action path for external repos by BYK in #704

🤖 This preview updates automatically when you update the PR.

@BYK BYK marked this pull request as ready for review January 12, 2026 18:25
@BYK BYK enabled auto-merge (squash) January 12, 2026 18:25
@BYK BYK disabled auto-merge January 12, 2026 18:28
@BYK BYK merged commit 5231703 into master Jan 12, 2026
16 checks passed
@BYK BYK deleted the fix/action-install-path-resolution branch January 12, 2026 18:35
BYK added a commit that referenced this pull request Jan 12, 2026
…llback (#705)

## Problem

The previous fix (#704) used `uses: getsentry/craft/install@${{
github.action_ref }}` which fails because the `github` context is not
available when the `uses:` field is evaluated:

```
Unrecognized named-value: 'github'. Located at position 1 within expression: github.action_ref
```

Additionally, the `install/` sub-action duplicated build logic (Node.js,
pnpm, build from source) that was already in the build job.

## Solution

Simplify the install flow:

1. **For dogfooding** (`getsentry/craft`): Download from build artifact
if available
2. **For all repos** (or if artifact unavailable): Download from release
using `github.action_ref`, with fallback to latest

This approach:
- ✅ Removes the `install/` sub-action entirely
- ✅ Eliminates duplicate build logic (Node.js/pnpm setup)
- ✅ Still enables dogfooding via the build job's artifact
- ✅ Works for external repos by downloading from releases
- ✅ Uses `github.action_ref` in a shell script where the context is
available

**Net result: 34 additions, 91 deletions** - much simpler!
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