From d0625c771a7f34977aef49b618b4e2abeae14adb Mon Sep 17 00:00:00 2001 From: Deepak Date: Thu, 26 Feb 2026 02:26:41 +0530 Subject: [PATCH] Adjust pr title --- .github/workflows/intercom-sdk-check.yml | 17 +++++++++++++++-- scripts/check_intercom_sdk_updates.dart | 8 +++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/intercom-sdk-check.yml b/.github/workflows/intercom-sdk-check.yml index 2c44f43d..ac38b3f2 100644 --- a/.github/workflows/intercom-sdk-check.yml +++ b/.github/workflows/intercom-sdk-check.yml @@ -27,11 +27,24 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Determine PR title + id: pr + if: steps.sdk.outputs.updates_available == 'true' + run: | + if [[ "${{ steps.sdk.outputs.android_updated }}" == "true" && "${{ steps.sdk.outputs.ios_updated }}" == "true" ]]; then + echo "title=Update intercom-android ${{ steps.sdk.outputs.android_version }} and intercom-ios ${{ steps.sdk.outputs.ios_version }}" >> "$GITHUB_OUTPUT" + elif [[ "${{ steps.sdk.outputs.android_updated }}" == "true" ]]; then + echo "title=Update intercom-android ${{ steps.sdk.outputs.android_version }}" >> "$GITHUB_OUTPUT" + else + echo "title=Update intercom-ios ${{ steps.sdk.outputs.ios_version }}" >> "$GITHUB_OUTPUT" + fi + - name: Create pull request + if: steps.sdk.outputs.updates_available == 'true' uses: peter-evans/create-pull-request@v6 with: - commit-message: 'Update Intercom SDK versions to ${{ steps.sdk.outputs.android_version }} for Android and ${{ steps.sdk.outputs.ios_version }} for iOS' - title: 'Update Intercom SDK versions to ${{ steps.sdk.outputs.android_version }} for Android and ${{ steps.sdk.outputs.ios_version }} for iOS' + commit-message: ${{ steps.pr.outputs.title }} + title: ${{ steps.pr.outputs.title }} body: | Automated Intercom SDK update. diff --git a/scripts/check_intercom_sdk_updates.dart b/scripts/check_intercom_sdk_updates.dart index d0b1e8aa..d9ab1b7e 100644 --- a/scripts/check_intercom_sdk_updates.dart +++ b/scripts/check_intercom_sdk_updates.dart @@ -144,7 +144,11 @@ String _updateChangelog(String contents, String version, List entries) { updatedLines.add(''); updatedLines.addAll(newEntries); updatedLines.add(''); - updatedLines.addAll(lines.skip(insertIndex + 1)); + var remainderStart = insertIndex + 1; + while (remainderStart < lines.length && lines[remainderStart].trim().isEmpty) { + remainderStart++; + } + updatedLines.addAll(lines.skip(remainderStart)); return updatedLines.join('\n'); } @@ -206,6 +210,8 @@ Future main(List args) async { _writeGithubOutputs({ 'android_version': latestAndroid, 'ios_version': latestIos, + 'android_updated': shouldUpdateAndroid.toString(), + 'ios_updated': shouldUpdateIos.toString(), 'plugin_version': nextPluginVersion, 'updates_available': shouldUpdate.toString(), });