nrwl / nx-set-shas

:sparkles: A Github Action which sets the base and head SHAs required for `nx affected` commands in CI
https://nx.dev
MIT License
162 stars 76 forks source link

Add support for git forking workflow #141

Open tschaffter opened 9 months ago

tschaffter commented 9 months ago

We use the git forking workflow and each developer open PRs against the upstream repo from their fork.

It seems from the code of nrwl/nx-set-shas@v4 that the main branch of the fork is used to compute the Base SHA, not the main branch of upstream. The code seems to systematically use origin/${mainBranchName}. In the context of a PR opened from a fork that target the upstream repo, origin refers to the remote of the fork.

Is there a way with the current implementation to have the Base SHA calculated using the actual target remote (e.g. upstream)?

If not, one solution would be to allow the user of the action to specify the remote too, in a similar way the action actions/checkout@v4 allows us to do so.

mandarini commented 5 months ago

Hi there @tschaffter ! I am looking into a way to implement this feature, but I am not sure how soon this will happen! If in the meantime you want to try implementing it, let me know and I can help!