Skip to content

Commit

Permalink
fixes check_diff to work on main (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaiton authored Nov 28, 2023
1 parent 61351e1 commit c5c30cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/check_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ jobs:
- name: Check for version changes
id: check
run: |
OLD_VERSION=$(git show ${{ github.event.pull_request.base.sha }}:${{ inputs.file_path }} | grep '^version = ' | cut -d '"' -f 2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# For PRs, compare PR head against base branch
OLD_VERSION=$(git show ${{ github.event.pull_request.base.sha }}:${{ inputs.file_path }} | grep '^version = ' | cut -d '"' -f 2)
else
# For direct pushes, compare the last two commits
OLD_VERSION=$(git show HEAD~1:${{ inputs.file_path }} | grep '^version = ' | cut -d '"' -f 2)
fi
# `cut` grabs everything inside the ", i.e. the version number x.y.z
NEW_VERSION=$(grep '^version = ' ${{ inputs.file_path }} | cut -d '"' -f 2)
echo "OLD_VERSION=$OLD_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]

name = "pypechain"
version = "0.0.11"
version = "0.0.12"
authors = [
{ name = "Matthew Brown", email = "matt@delv.tech" },
{ name = "Dylan Paiton", email = "dylan@delv.tech" },
Expand Down

0 comments on commit c5c30cd

Please sign in to comment.