From 48d9c95e3210701490cabb34888b4a7a993872c0 Mon Sep 17 00:00:00 2001 From: Chun-Heng Tai Date: Wed, 3 Jun 2026 12:10:16 -0700 Subject: [PATCH] [ci] Renames the override post-release label for batch release --- .github/workflows/batch_release_pr.yml | 3 ++- .github/workflows/sync_release_pr.yml | 7 ++++--- .../validators/version_and_changelog_validator.dart | 11 +++++++---- script/tool/test/validate_command_version_test.dart | 4 ++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/batch_release_pr.yml b/.github/workflows/batch_release_pr.yml index df4fe2509bc8..aebf9eb58e8d 100644 --- a/.github/workflows/batch_release_pr.yml +++ b/.github/workflows/batch_release_pr.yml @@ -68,6 +68,7 @@ jobs: --base "${{ needs.create_batch_release_branch.outputs.release_branch }}" \ --head "${{ env.HEAD_BRANCH_NAME }}" \ --title "[${{ github.event.client_payload.package }}] Batch release" \ - --body "This PR was created automatically to batch release the \`${{ github.event.client_payload.package }}\`." + --body "This PR was created automatically to batch release the \`${{ github.event.client_payload.package }}\`." \ + --label "override: skip-batch-release-repo-check-${{ github.event.client_payload.package }}" diff --git a/.github/workflows/sync_release_pr.yml b/.github/workflows/sync_release_pr.yml index 89422be6803f..b13486dc5998 100644 --- a/.github/workflows/sync_release_pr.yml +++ b/.github/workflows/sync_release_pr.yml @@ -35,9 +35,10 @@ jobs: exit 0 fi - # 3. Extract release name without version for label + # 3. Extract package name for label BRANCH_NAME="${{ github.ref_name }}" - RELEASE_NAME="${BRANCH_NAME%-*}" + TEMP="${BRANCH_NAME#release-}" + PACKAGE_NAME="${TEMP%-*}" # 4. Create the PR directly gh pr create \ @@ -45,4 +46,4 @@ jobs: --head "${{ github.ref_name }}" \ --title "Sync ${{ github.ref_name }} to main" \ --body "This automated PR syncs the changes from the release branch ${{ github.ref_name }} back to the main branch." \ - --label "override: post-${RELEASE_NAME}" + --label "override: skip-batch-release-repo-check-${PACKAGE_NAME}" diff --git a/script/tool/lib/src/validators/version_and_changelog_validator.dart b/script/tool/lib/src/validators/version_and_changelog_validator.dart index c6866294a582..f8691feee6ef 100644 --- a/script/tool/lib/src/validators/version_and_changelog_validator.dart +++ b/script/tool/lib/src/validators/version_and_changelog_validator.dart @@ -164,12 +164,15 @@ class VersionAndChangelogValidator { pubspec: pubspec, ignorePlatformInterfaceBreaks: ignorePlatformInterfaceBreaks, ); - // PR with post release label is going to sync changelog.md and pubspec.yaml - // change back to main branch. Proceed with regular version check. - final bool hasPostReleaseLabel = _prLabels.contains('override: post-release-${pubspec.name}'); + // PR with override: skip-batch-release-repo-check- label is going to sync + // changelog.md and pubspec.yaml changes back to main branch. + // Proceed with regular version check. + final bool shouldSkipBatchReleaseRepoCheck = _prLabels.contains( + 'override: skip-batch-release-repo-check-${pubspec.name}', + ); bool versionChanged; - if (usesBatchRelease && !hasPostReleaseLabel) { + if (usesBatchRelease && !shouldSkipBatchReleaseRepoCheck) { versionChanged = await _validatePendingChangeForBatchReleasePackage( package: package, changedFiles: _changedFiles, diff --git a/script/tool/test/validate_command_version_test.dart b/script/tool/test/validate_command_version_test.dart index 0c98b9302748..0cce3e7864c6 100644 --- a/script/tool/test/validate_command_version_test.dart +++ b/script/tool/test/validate_command_version_test.dart @@ -1584,7 +1584,7 @@ release: ); }); test( - 'ignores changelog and pubspec yaml version modifications check with override: post-release label', + 'ignores changelog and pubspec yaml version modifications check with override: skip-batch-release-repo-check label', () async { final RepositoryPackage package = createFakePackage( 'package', @@ -1615,7 +1615,7 @@ packages/package/pubspec.yaml final List output = await runCapturingPrint(runner, [ 'validate', '--base-sha=main', - '--pr-labels=override: post-release-package', + '--pr-labels=override: skip-batch-release-repo-check-package', ]); expect(