diff --git a/.github/workflows/batch_release_pr.yml b/.github/workflows/batch_release_pr.yml index 134c9870883..412f87ec244 100644 --- a/.github/workflows/batch_release_pr.yml +++ b/.github/workflows/batch_release_pr.yml @@ -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" diff --git a/.github/workflows/go_router_batch.yml b/.github/workflows/go_router_batch.yml index 90ef2edf6b5..a245459202f 100644 --- a/.github/workflows/go_router_batch.yml +++ b/.github/workflows/go_router_batch.yml @@ -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 diff --git a/script/tool/lib/src/common/file_filters.dart b/script/tool/lib/src/common/file_filters.dart index da675319197..7a1bafd06a5 100644 --- a/script/tool/lib/src/common/file_filters.dart +++ b/script/tool/lib/src/common/file_filters.dart @@ -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/'); diff --git a/script/tool/test/common/file_filters_test.dart b/script/tool/test/common/file_filters_test.dart new file mode 100644 index 00000000000..0143fb3dde3 --- /dev/null +++ b/script/tool/test/common/file_filters_test.dart @@ -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); + }); + }); +}