Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/batch_release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"


7 changes: 4 additions & 3 deletions .github/workflows/sync_release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ 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 \
--base "main" \
--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}"
Original file line number Diff line number Diff line change
Expand Up @@ -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-<package> 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,
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/validate_command_version_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -1615,7 +1615,7 @@ packages/package/pubspec.yaml
final List<String> output = await runCapturingPrint(runner, <String>[
'validate',
'--base-sha=main',
'--pr-labels=override: post-release-package',
'--pr-labels=override: skip-batch-release-repo-check-package',
]);

expect(
Expand Down
Loading