Skip to content

Commit 8d8b80b

Browse files
committed
Fix codex outdated condition check
npm install must be performed before running npm outdated
1 parent f20bd8d commit 8d8b80b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/codex-update.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ jobs:
2323
- name: Check if update is required
2424
id: check
2525
run: |
26-
if npm outdated "$CODEX_PACKAGE"; then
27-
echo "Package is up to date"
26+
RAW=$(jq -r --arg pkg "$CODEX_PACKAGE" '.dependencies[$pkg]' package.json)
27+
CURRENT="${RAW#[\^~]}"
28+
LATEST=$(npm view "$CODEX_PACKAGE" version)
29+
30+
if [ "$CURRENT" = "$LATEST" ]; then
31+
echo "Package is up to date ($CURRENT)"
2832
exit 0
2933
fi
3034
31-
LATEST=$(npm view "$CODEX_PACKAGE" version)
3235
BRANCH="codex-update/$LATEST"
3336
3437
if git ls-remote --exit-code --heads origin "refs/heads/$BRANCH" >/dev/null 2>&1; then

0 commit comments

Comments
 (0)