skip-duplicate-actions icon indicating copy to clipboard operation
skip-duplicate-actions copied to clipboard

Comparing commits (base and head refs)

Open gagle opened this issue 5 years ago • 1 comments

How can I pass in the base and head refs to allow calculating the diff from 2 arbitrary commits? I'm using a slash-dispatch-command action and I receive the abse and head refs in a repository-dispatch event. I created this action (https://github.com/gagle/changed-directories) some time ago to calculate the diff between 2 commits but it would be great to have all these utilities inside your action. Internally I'm using octokit.repos.compareCommits() function but I see that you're not using it, you seem to do a recursive loop, right? Have you checked this function? What is the best approach?

gagle avatar Dec 10 '20 08:12 gagle

This Action doesn't do a recursive loop, but it does a backtracing from the current commit to previous commits (not in all cases). But perhaps https://github.com/dorny/paths-filter might be a better reference for your purposes.

fkirc avatar Dec 10 '20 09:12 fkirc