-
Notifications
You must be signed in to change notification settings - Fork 0
/
script-change-phpunit-config.sh
executable file
·90 lines (72 loc) · 2.02 KB
/
script-change-phpunit-config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
#
# Checkout and update the branch on all repos
set -e
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
BRANCH_NAME=update-$DEFAULT_BRANCH-phpunit-config
echo "Fetch $DEFAULT_BRANCH"
echo "======================"
git fetch origin $DEFAULT_BRANCH
echo "Checkout $DEFAULT_BRANCH"
echo "======================"
git checkout $DEFAULT_BRANCH
echo "Reset $DEFAULT_BRANCH"
echo "======================"
git reset --hard origin/$DEFAULT_BRANCH
set +e
echo ""
echo "Delete existing branch"
echo "======================"
git branch -D $BRANCH_NAME
set -e
echo ""
echo "Checkout branch"
echo "======================"
git checkout -b $BRANCH_NAME
CHANGED="0"
for FILE in phpunit.xml \
tests/phpunit.xml \
tests/phpunit/phpunit.xml \
tests/php/phpunit.xml \
tests/unit/phpunit.xml \
tests/Unit/phpunit.xml \
phpunit.integration.xml \
tests/phpunit.integration.xml \
.github/workflows/phpunit-oci.yml \
.github/workflows/phpunit-pgsql.yml \
.github/workflows/phpunit-sqlite.yml \
.github/workflows/integration.yml \
.github/workflows/static-analysis.yml \
.github/workflows/php-test.yml \
.github/workflows/test.yml \
.github/workflows/psalm.yml
do
if [ -f $FILE ]; then
echo ""
echo "Update $FILE"
echo "======================"
gedit $FILE
echo ""
echo "Add file to git status"
echo "======================"
git add $FILE
CHANGED="1"
fi
done
if [[ "$CHANGED" = "0" ]]; then
echo "No testing"
exit 1
fi
echo ""
echo "Commit branch"
echo "======================"
git commit -m "Adjust phpunit config in $DEFAULT_BRANCH
Signed-off-by: Joas Schilling <[email protected]>"
echo ""
echo "Push branch"
echo "======================"
git push origin $BRANCH_NAME
echo ""
echo "Create PR"
echo "======================"
gh pr create --base $DEFAULT_BRANCH --fill >> ../../pr-list.txt