Skip to content

Commit fe75425

Browse files
committed
Fix missing version check expected in PR preview
Signed-off-by: lelia <lelia@socket.dev>
1 parent 9b855c2 commit fe75425

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/version-check.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ jobs:
1818
- name: Check version increment
1919
id: version_check
2020
run: |
21+
python -m pip install --upgrade pip
22+
pip install packaging
23+
2124
# Get version from current PR
2225
PR_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
2326
echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV
2427
2528
# Get version from main branch
26-
git checkout origin/main
27-
MAIN_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
29+
MAIN_VERSION=$(git show origin/main:socketsecurity/__init__.py | grep -o "__version__.*" | awk '{print $3}' | tr -d "'")
2830
echo "MAIN_VERSION=$MAIN_VERSION" >> $GITHUB_ENV
2931
3032
# Compare versions using Python
@@ -87,4 +89,4 @@ jobs:
8789
issue_number: prNumber,
8890
body: `❌ **Version Check Failed**\n\nPlease increment...`
8991
});
90-
}
92+
}

0 commit comments

Comments
 (0)