Skip to content

Commit

Permalink
Update updateVersion.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jagankumar-egov authored Jan 9, 2024
1 parent 7b8e95b commit a18abd0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/updateVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ jobs:
current_version=$(jq -r --arg dep "$dependency" '.devDependencies[$dep]' "$SOURCE_JSON_FILE")
echo "CURRENT_VERSION=$current_version"

# Get the version from the commit before the last one for the specific file
last_commit_version=$(git log -n 2 --pretty=format:%h -- "$SOURCE_JSON_FILE" | tail -n 1 | xargs git show | jq -r --arg dep "$dependency" '.devDependencies[$dep]')
# Get the commit hash of the last two commits for the specific file
commit_hash=$(git log -n 2 --pretty=format:%h -- "$SOURCE_JSON_FILE" | tail -n 1)
echo "Commit hash: $commit_hash"

# Get the version from the commit
last_commit_version=$(git show "$commit_hash":"$SOURCE_JSON_FILE" | jq -r --arg dep "$dependency" '.devDependencies[$dep]')
echo "last_commit_version=$last_commit_version"

# Check if the versions are different
Expand Down

0 comments on commit a18abd0

Please sign in to comment.