Skip to content

Commit

Permalink
feature/diff commit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
choewy committed Mar 18, 2024
1 parent 4930f7c commit 1d38451
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- run: |
previous_commit=$(git log --format=%H -n 2 | tail -n 1)
previous=$(git show $previous_commit:package.json | grep '"version"' | awk -F '"' '{print $4}')
previous=$(git show $HEAD^:package.json | grep '"version"' | awk -F '"' '{print $4}')
current_commit=$(git log --format=%H -n 1)
current=$(git show HEAD:package.json | grep '"version"' | awk -F '"' '{print $4}')
echo "$previous_commit $current_commit $previous $current"

0 comments on commit 1d38451

Please sign in to comment.