@@ -37,14 +37,36 @@ jobs:
37
37
- name : Get current version from context.ts
38
38
id : current-version
39
39
run : |
40
+ echo "Debugging: Looking for version in context.ts"
41
+ grep -n "NDC_NODEJS_LAMBDA_SDK_VERSION" src/app/context.ts || echo "Pattern not found"
42
+
40
43
CURRENT_VERSION=$(grep -E "const NDC_NODEJS_LAMBDA_SDK_VERSION = " src/app/context.ts | sed -E 's/.*"([^"]+)".*/\1/')
44
+
45
+ if [ -z "$CURRENT_VERSION" ]; then
46
+ echo "❌ Failed to extract current version from context.ts"
47
+ echo "File content around the version:"
48
+ grep -A2 -B2 "NDC_NODEJS_LAMBDA_SDK_VERSION" src/app/context.ts || echo "No matches found"
49
+ exit 1
50
+ fi
51
+
41
52
echo "current-version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
42
53
echo "Current version in context.ts: $CURRENT_VERSION"
43
54
44
55
- name : Get latest release from GitHub API
45
56
id : latest-release
46
57
run : |
47
- LATEST_RELEASE=$(curl -s https://api.github.com/repos/hasura/ndc-nodejs-lambda/releases/latest | jq -r '.tag_name')
58
+ echo "Debugging: Fetching latest release from GitHub API"
59
+ API_RESPONSE=$(curl -s https://api.github.com/repos/hasura/ndc-nodejs-lambda/releases/latest)
60
+ echo "API Response: $API_RESPONSE"
61
+
62
+ LATEST_RELEASE=$(echo "$API_RESPONSE" | jq -r '.tag_name')
63
+
64
+ if [ -z "$LATEST_RELEASE" ] || [ "$LATEST_RELEASE" = "null" ]; then
65
+ echo "❌ Failed to extract latest release version"
66
+ echo "API Response was: $API_RESPONSE"
67
+ exit 1
68
+ fi
69
+
48
70
echo "latest-version=$LATEST_RELEASE" >> $GITHUB_OUTPUT
49
71
echo "Latest release: $LATEST_RELEASE"
50
72
53
75
run : |
54
76
CURRENT="${{ steps.current-version.outputs.current-version }}"
55
77
LATEST="${{ steps.latest-release.outputs.latest-version }}"
56
-
78
+
79
+ echo "Debugging version comparison:"
80
+ echo "CURRENT: '$CURRENT'"
81
+ echo "LATEST: '$LATEST'"
82
+
83
+ # Validate that we have non-empty versions
84
+ if [ -z "$CURRENT" ] || [ "$CURRENT" = "null" ]; then
85
+ echo "❌ Current version is empty or null"
86
+ exit 1
87
+ fi
88
+
89
+ if [ -z "$LATEST" ] || [ "$LATEST" = "null" ]; then
90
+ echo "❌ Latest version is empty or null"
91
+ exit 1
92
+ fi
93
+
57
94
if [ "$CURRENT" = "$LATEST" ]; then
58
95
echo "needs-update=false" >> $GITHUB_OUTPUT
59
96
echo "✅ Already up to date: $CURRENT"
0 commit comments