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

Support subdirectory #11

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

Support subdirectory #11

wants to merge 1 commit into from

Conversation

ursm
Copy link

@ursm ursm commented Jan 17, 2024

Added support for the case where package.json is in a subdirectory instead of the repository root.
Real-world use case: https://github.com/ddbj/ddbj-repository/blob/7d2ea35eb1b4a1042fd696ecac83d91f4ab7f8a3/.github/workflows/web.yml#L21

I tried to respect the parameters of the original action as much as possible, but would it be better to define one parameter like root and use it to automatically generate the node-version-file, cache-dependency-path and working-directory?

@ursm ursm changed the title Suport subdirectory Support subdirectory Jan 17, 2024
@Yelinz
Copy link

Yelinz commented Jan 17, 2024

Just had the same problem with a sub-directory project. The arg working-directory is crucial

echo "Could not find package.json. Did actions/checkout run?"
exit 1
fi

forcedVersion=${{inputs.pnpm-version}}
packageJson=$(cat package.json)
Copy link
Contributor

Choose a reason for hiding this comment

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

this will error if node-version-file is not a json file.

node-version-file is meant for setup-node, rather than just the package.json. it can be an .nvmrc, .node-version, etc

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe instead, the working-directory should prefix?

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.

3 participants