Skip to content

Commit 0ceed6c

Browse files
committed
ci: Simplify rollback logic for uncommitted changes in CI workflow
1 parent 3e8c8bf commit 0ceed6c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,19 @@ jobs:
5252
- name: Lint
5353
run: dart format --output=none --set-exit-if-changed packages/dart
5454
- name: Rollback uncommitted changes for Fix Bug mocks
55+
shell: pwsh
5556
run: |
56-
git checkout -- packages\dart\test\src\network\parse_query_test.mocks.dart packages\dart\test\src\objects\parse_object\parse_object_test.mocks.dart
57+
$files = @(
58+
"packages\dart\test\src\network\parse_query_test.mocks.dart",
59+
"packages\dart\test\src\objects\parse_object\parse_object_test.mocks.dart"
60+
)
61+
$files | ForEach-Object {
62+
if (Test-Path $_) {
63+
git checkout -- $_
64+
} else {
65+
Write-Host "File $_ does not exist, skipping checkout."
66+
}
67+
}
5768
- name: Publish dry run
5869
run: cd packages/dart && dart pub publish --dry-run
5970
- name: Run tests

0 commit comments

Comments
 (0)