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

doc: Explain differencs in CWD when run in a composite action #368

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dekimsey
Copy link

@dekimsey dekimsey commented Apr 17, 2023

This documents an easy to make mistake regarding how to require a resource from the action's source. When a relative
path is used, the CWD is the workflow's not the composite action's. This surfaces to calling workflows as a MODULE_NOT_FOUND error.

With respect to the code-sample, ideally we'd use the github.action_path (or soon, github.host-workspace) context in our example. But until actions/runner#2517 is completed, at this time it's safer to use process.env.GITHUB_ACTION_PATH which is correct regardless of how the action is invoked.

This documents an easy to make mistake regarding how
to require a resource from the action's source. When a relative
path is used, the CWD is the workflow's not the composite
action's. This surfaces to calling workflows as a
`MODULE_NOT_FOUND` error.
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.

None yet

1 participant