1515 uses : actions/checkout@v4
1616 with :
1717 path : ' aws-sdk-kotlin'
18+ ref : ' ${{ github.head_ref }}'
19+ fetch-depth : 0
1820
1921 - name : Configure Gradle
2022 uses : awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
@@ -37,27 +39,33 @@ jobs:
3739 path : ' smithy-kotlin'
3840 repository : ' smithy-lang/smithy-kotlin'
3941
40- # TODO: Change grep pattern when we decouple runtime and codegen releases
4142 - name : Check for smithy-kotlin unreleased changes
4243 run : |
4344 cd aws-sdk-kotlin
4445 SDK_BRANCH=$(git branch --show-current)
46+ echo "aws-sdk-kotlin branch: $SDK_BRANCH"
4547
4648 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"
4851
49- if [ "$SDK_BRANCH" = "$SMITHY_BRANCH " ]; then
52+ if [ "$SDK_BRANCH" == "$SMITHY_KOTLIN_BRANCH " ]; then
5053 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"
5561 exit 1
62+ else
63+ echo "::warning::Matching smithy-kotlin and aws-sdk-kotlin branches with smithy-kotlin version bump detected"
5664 fi
5765 fi
5866
5967 - name : Emit error message
6068 if : ${{ failure() }}
6169 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?"
6371 exit 1
0 commit comments