Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/batch_release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Create batch release PR
if: steps.check-branch-exists.outputs.exists == 'true'
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "[${{ github.event.client_payload.package }}] Batch release"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go_router_batch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v4
uses: peter-evans/repository-dispatch@5fc4efd1a4797ddb68ffd0714a238564e4cc0e6f
with:
token: "${{ secrets.GITHUB_TOKEN }}"
event-type: batch_release_pr
Expand Down
5 changes: 3 additions & 2 deletions script/tool/lib/src/common/file_filters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ bool isRepoLevelNonCodeImpactingFile(String path) {
'.github/dependabot.yml',
'.github/labeler.yml',
'.github/post_merge_labeler.yml',
'.github/workflows/release.yml',
'.github/workflows/pull_request_label.yml',
].contains(path) ||
// This directory contains github action workflow files, and the package
// repository does not use github actions for tests.
path.startsWith('.github/workflows/') ||
// This directory only affects automated code reviews, so cannot affect
// any package tests.
path.startsWith('.gemini/');
Expand Down
71 changes: 71 additions & 0 deletions script/tool/test/common/file_filters_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter_plugin_tools/src/common/file_filters.dart';
import 'package:test/test.dart';

void main() {
group('isRepoLevelNonCodeImpactingFile', () {
test('returns true for known non-code files', () {
expect(isRepoLevelNonCodeImpactingFile('AUTHORS'), isTrue);
expect(isRepoLevelNonCodeImpactingFile('CODEOWNERS'), isTrue);
expect(isRepoLevelNonCodeImpactingFile('CONTRIBUTING.md'), isTrue);
expect(isRepoLevelNonCodeImpactingFile('LICENSE'), isTrue);
expect(isRepoLevelNonCodeImpactingFile('README.md'), isTrue);
expect(isRepoLevelNonCodeImpactingFile('AGENTS.md'), isTrue);
expect(
isRepoLevelNonCodeImpactingFile('.github/PULL_REQUEST_TEMPLATE.md'),
isTrue,
);
expect(isRepoLevelNonCodeImpactingFile('.github/dependabot.yml'), isTrue);
expect(isRepoLevelNonCodeImpactingFile('.github/labeler.yml'), isTrue);
expect(
isRepoLevelNonCodeImpactingFile('.github/post_merge_labeler.yml'),
isTrue,
);
expect(
isRepoLevelNonCodeImpactingFile('.github/workflows/release.yml'),
isTrue,
);
expect(
isRepoLevelNonCodeImpactingFile(
'.github/workflows/pull_request_label.yml',
),
isTrue,
);
expect(
isRepoLevelNonCodeImpactingFile(
'.github/workflows/batch_release_pr.yml',
),
isTrue,
);
expect(
isRepoLevelNonCodeImpactingFile(
'.github/workflows/go_router_batch.yml',
),
isTrue,
);
expect(
isRepoLevelNonCodeImpactingFile('.github/workflows/ci.yml'),
isTrue,
);
expect(
isRepoLevelNonCodeImpactingFile(
'.github/workflows/any_new_workflow.yml',
),
isTrue,
);
});

test('returns true for .gemini/ files', () {
expect(isRepoLevelNonCodeImpactingFile('.gemini/foo'), isTrue);
expect(isRepoLevelNonCodeImpactingFile('.gemini/bar/baz'), isTrue);
});

test('returns false for other files', () {
expect(isRepoLevelNonCodeImpactingFile('pubspec.yaml'), isFalse);
expect(isRepoLevelNonCodeImpactingFile('lib/main.dart'), isFalse);
});
});
}