Skip to content

Commit 85b3b7e

Browse files
committed
Fixing version logic
1 parent 2e06a46 commit 85b3b7e

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

.github/workflows/version-check.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,16 @@ jobs:
1515
with:
1616
fetch-depth: 0 # Fetch all history for all branches
1717

18-
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install hatchling==1.27.0
22-
pip install hatch==1.14.0
23-
pip install packaging
24-
2518
- name: Check version increment
2619
id: version_check
2720
run: |
2821
# Get version from current PR
29-
PR_VERSION=$(hatch version)
22+
PR_VERSION=$(grep -o "__version__.*" socketdev/version.py | awk '{print $3}' | tr -d "'")
3023
echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV
3124
3225
# Get version from main branch
3326
git checkout origin/main
34-
pip install hatchling==1.27.0 hatch==1.14.0
35-
MAIN_VERSION=$(hatch version)
27+
MAIN_VERSION=$(grep -o "__version__.*" socketdev/version.py | awk '{print $3}' | tr -d "'")
3628
echo "MAIN_VERSION=$MAIN_VERSION" >> $GITHUB_ENV
3729
3830
# Compare versions using Python
@@ -84,7 +76,7 @@ jobs:
8476
owner: owner,
8577
repo: repo,
8678
comment_id: versionComment.id,
87-
body: `❌ **Version Check Failed**\n\nPlease increment the version. Current version in main: ${process.env.MAIN_VERSION}, PR version: ${process.env.PR_VERSION}`
79+
body: `❌ **Version Check Failed**\n\nPlease increment...`
8880
});
8981
}
9082
} else if (!success) {
@@ -93,6 +85,6 @@ jobs:
9385
owner: owner,
9486
repo: repo,
9587
issue_number: prNumber,
96-
body: `❌ **Version Check Failed**\n\nPlease increment the version. Current version in main: ${process.env.MAIN_VERSION}, PR version: ${process.env.PR_VERSION}`
88+
body: `❌ **Version Check Failed**\n\nPlease increment...`
9789
});
9890
}

0 commit comments

Comments
 (0)