upload-rust-binary-action icon indicating copy to clipboard operation
upload-rust-binary-action copied to clipboard

Support working-directory

Open renatoathaydes opened this issue 1 year ago • 5 comments

GitHub Actions like runs support changing the working-directory.

This is important as many repositories contain more than one project.

I may be missing something, but I can't seem to make the working-dir declared in defaults to work with this action.

Maybe that's not possible, but it would be nice if at least this action took an optional working-directory as input so that if I have a crate under ./my-crate/ instead of at the root, I won't get this error:

error: could not find `Cargo.toml` in `/home/runner/work/my-repo/my-repo` or any parent directory

renatoathaydes avatar Apr 27 '24 10:04 renatoathaydes

error: could not find Cargo.toml in /home/runner/work/my-repo/my-repo or any parent directory

I believe you have to use manifest-path input option. (If you use this action outside of the cargo workspace, there is no way for the action side to automatically search for workspace based on the current directory.)

taiki-e avatar Apr 27 '24 10:04 taiki-e

Thanks @taiki-e , I did end up using that and it worked. Still, could be a nice feature to allow using the fairly common input working-directory (which just means you change the working-directory before running anything else)? Anyway, feel free to close this ticket if you're not interested in adding that.

renatoathaydes avatar Apr 27 '24 11:04 renatoathaydes

I thought working-directory: could be used together with uses:, is that not so?

taiki-e avatar Apr 27 '24 11:04 taiki-e

My understanding is that it will only work if you make that part of your action's input.

renatoathaydes avatar Apr 28 '24 12:04 renatoathaydes

Ok, if the native working-directory option cannot be used, I would accept a PR to add a working-directory input option.

taiki-e avatar Apr 28 '24 13:04 taiki-e