Created
January 20, 2023 19:52
-
-
Save mikaelvesavuori/3d607d31fe777e2b0f548cc4f4148815 to your computer and use it in GitHub Desktop.
Get git diff between the current and last commit in GitHub Actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { simpleGit } from 'simple-git'; | |
| diff(github.context.payload.after, github.context.payload.before); | |
| async function diff(after: string, before: string) { | |
| const git = simpleGit(); | |
| const diff = await git.diffSummary([after, before]); | |
| console.log(diff); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment