Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(actions): resolve actions when there aren't user actions #11525

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

ematipico
Copy link
Member

Changes

Closes #11354

The issue was caused by the static analyzer of rollup, where it was trying to "understand" if import(import.meta.env.ACTIONS_PATH) was a valid import. The function getAction wasn't even called, at all, during the build, because there were not actions to begin with.

This issue was caused by the previous code's assumption that actions/index.ts was always present, which was not the case. This issue would have surfaced once the experimental flag was removed.

I fixed the issue by using the same approach we use in the middleware, where we have an internal virtual module, and we return a noop code in case the user didn't specify any action.

This PR also removes the need to have an environment variable.

Testing

Current CI should pass. I tested it locally by using the reproduction provided by the user.

Docs

Copy link

changeset-bot bot commented Jul 22, 2024

🦋 Changeset detected

Latest commit: e7e6dd6

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jul 22, 2024
@ematipico ematipico changed the title fix(actions): pass path as input fix(actions): resolve actions when there aren't user actions Jul 22, 2024
@ematipico ematipico force-pushed the fix/actions-import-meta-env branch from 545d2a7 to db11cfe Compare July 22, 2024 09:28
@ematipico ematipico force-pushed the fix/actions-import-meta-env branch from 6277d08 to 7d58981 Compare July 22, 2024 09:41
@ematipico ematipico requested a review from bholmesdev July 22, 2024 10:26
Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking action on this! Couple nits, non-blocking

@ematipico ematipico merged commit 8068131 into main Jul 22, 2024
13 checks passed
@ematipico ematipico deleted the fix/actions-import-meta-env branch July 22, 2024 12:15
@astrobot-houston astrobot-houston mentioned this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using Astro Actions causes Build Error
2 participants