15
15
uses : actions/checkout@v4
16
16
with :
17
17
path : ' aws-sdk-kotlin'
18
+ ref : ' ${{ github.head_ref }}'
19
+ fetch-depth : 0
18
20
19
21
- name : Configure Gradle
20
22
uses : awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
@@ -37,27 +39,33 @@ jobs:
37
39
path : ' smithy-kotlin'
38
40
repository : ' smithy-lang/smithy-kotlin'
39
41
40
- # TODO: Change grep pattern when we decouple runtime and codegen releases
41
42
- name : Check for smithy-kotlin unreleased changes
42
43
run : |
43
44
cd aws-sdk-kotlin
44
45
SDK_BRANCH=$(git branch --show-current)
46
+ echo "aws-sdk-kotlin branch: $SDK_BRANCH"
45
47
46
48
cd ../smithy-kotlin
47
- SMITHY_BRANCH=$(git branch --show-current)
49
+ SMITHY_KOTLIN_BRANCH=$(git branch --show-current)
50
+ echo "smithy-kotlin branch: $SMITHY_KOTLIN_BRANCH"
48
51
49
- if [ "$SDK_BRANCH" = "$SMITHY_BRANCH " ]; then
52
+ if [ "$SDK_BRANCH" == "$SMITHY_KOTLIN_BRANCH " ]; then
50
53
cd ../aws-sdk-kotlin
51
- git diff origin/main -- gradle/libs.versions.toml | grep -E "smithy-kotlin-runtime-version|smithy-kotlin-codegen-version"
52
- export SMITHY_KOTLIN_VERSION_BUMP=$($?)
53
-
54
- if [ "$SMITHY_KOTLIN_VERSION_BUMP" != 0 ]; then
54
+ git fetch origin
55
+
56
+ DIFF=$(git diff origin/main -- gradle/libs.versions.toml | grep '^[-+][^-+]'; exit 0)
57
+ SMITHY_KOTLIN_VERSION_BUMP=$(echo "$DIFF" | grep "smithy-kotlin-runtime-version =\|smithy-kotlin-codegen-version ="; exit 0)
58
+
59
+ if [ -z "$SMITHY_KOTLIN_VERSION_BUMP" ]; then
60
+ echo "::error::Matching smithy-kotlin and aws-sdk-kotlin branches but no smithy-kotlin version bump"
55
61
exit 1
62
+ else
63
+ echo "::warning::Matching smithy-kotlin and aws-sdk-kotlin branches with smithy-kotlin version bump detected"
56
64
fi
57
65
fi
58
66
59
67
- name : Emit error message
60
68
if : ${{ failure() }}
61
69
run : |
62
- echo "::error ::Did you forget to release smithy-kotlin and bump the dependency version?"
70
+ echo "::error::Did you forget to release smithy-kotlin and bump the dependency version?"
63
71
exit 1
0 commit comments