Skip to content

Check diff when using actions/Checkout #26173

Discussion options

You must be logged in to vote

When use Checkout@v2, only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set fetch-depth to fetch more history. In your case, you could set fetch-depth=2. Then you could run 

git diff HEAD^ HEAD to get the diff comparing to the last commit. 

Please see my example:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants