fix(action): Resolve install sub-action path for external repos#704
Merged
fix(action): Resolve install sub-action path for external repos#704
Conversation
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
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
betegon
approved these changes
Jan 12, 2026
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!
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When external repositories (like
sentry-capacitor) usegetsentry/craft@v2, the composite action fails at the "Install Craft" step:GitHub Actions incorrectly resolves the relative
./installpath against the calling repository's checkout directory instead of the Craft action's directory.Solution
Use two conditional steps that handle both scenarios:
github.repository == 'getsentry/craft'): Uses./installwhich works because the checkout is in the Craft repogetsentry/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.