DEV Community

Discussion on: Running Nx Affected Commands in GitHub Actions

Collapse
 
poloagustin profile image
Agustin Polo

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 😅

Thread Thread
 
poloagustin profile image
Agustin Polo

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!

Thread Thread
 
devinshoemaker profile image
Devin Shoemaker

Cool! Thanks for the reply! I will test that out and update the post if it works well!

Thread Thread
 
devinshoemaker profile image
Devin Shoemaker

I finally got around to testing this fix and updating this blog post. Thanks again Agustin!