Skip to content

Commit e849267

Browse files
committed
Added a script to update playwright versions in all branches
1 parent e034a6a commit e849267

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

scripts/update-playwright.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# Fetch all remote branches to ensure the list is up-to-date
4+
git fetch --all
5+
6+
# Get a list of all branches starting with "sample-code/"
7+
branches=$(git branch -r | grep "origin/sample-code/" | sed 's/origin\///')
8+
9+
# Loop through each branch and perform the update
10+
for branch in $branches; do
11+
echo "Processing branch: $branch"
12+
13+
# Check out the branch
14+
git checkout $branch
15+
if [ $? -ne 0 ]; then
16+
echo "Failed to check out branch: $branch. Skipping..."
17+
continue
18+
fi
19+
20+
# Update Playwright dependency
21+
mvn versions:use-latest-versions -Dincludes=com.microsoft.playwright:playwright
22+
if [ $? -ne 0 ]; then
23+
echo "Failed to update Playwright in branch: $branch. Skipping..."
24+
continue
25+
fi
26+
27+
# Stage and commit changes
28+
git add pom.xml
29+
git commit -m "Updated Playwright version to the latest version"
30+
if [ $? -ne 0 ]; then
31+
echo "Failed to commit changes in branch: $branch. Skipping..."
32+
continue
33+
fi
34+
35+
# Push changes to GitHub
36+
git push origin $branch
37+
if [ $? -ne 0 ]; then
38+
echo "Failed to push changes for branch: $branch. Skipping..."
39+
continue
40+
fi
41+
42+
echo "Successfully updated branch: $branch"
43+
done
44+
45+
echo "All branches starting with 'sample-code/' have been processed."

0 commit comments

Comments
 (0)