Thanks! I have noticed that this doesn't appear to work with PR's from a separate repo (e.g. somebody made a PR to my open source project and the workflow failed due to branching weirdness). However, if you're not dealing with forked repos then this should work well! If I find a solution for forked repos then I will be posting an update.
Any ideas on those forking cases? I'm dealing with Error: Command failed: git merge-base origin/master HEAD
Was hoping this post would shine a light on this 😅
For forked repos I was able to run a gh actions workflow by removing the ref: ${{ github.event.pull_request.head.ref }} from your example. This enabled the workflow to pull the forked branch commit, with it's history, then fetch the base master branch with the defined depth and the affected:lint command worked in the end :)
Hope it helps someone!
Thank you for this. Migrating our app into nx has been quite painful and this I hope is one of the last pain points. Cheers!
Thanks! I have noticed that this doesn't appear to work with PR's from a separate repo (e.g. somebody made a PR to my open source project and the workflow failed due to branching weirdness). However, if you're not dealing with forked repos then this should work well! If I find a solution for forked repos then I will be posting an update.
Any ideas on those forking cases? I'm dealing with
Error: Command failed: git merge-base origin/master HEAD
Was hoping this post would shine a light on this 😅
For forked repos I was able to run a gh actions workflow by removing the
ref: ${{ github.event.pull_request.head.ref }}
from your example. This enabled the workflow to pull the forked branch commit, with it's history, then fetch the base master branch with the defined depth and theaffected:lint
command worked in the end :)Hope it helps someone!
Cool! Thanks for the reply! I will test that out and update the post if it works well!
I finally got around to testing this fix and updating this blog post. Thanks again Agustin!