-
Notifications
You must be signed in to change notification settings - Fork 76
/
github-action-push
executable file
·38 lines (31 loc) · 1.49 KB
/
github-action-push
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
#!/bin/sh -e
vendor/bin/php-coveralls --coverage_clover=coverage.clover -o build/result/coveralls-upload.json -v
# Set for all push in this script.
git config --global user.name "GithubAction"
git config --global user.email "zordius@users.noreply.gihub.com"
# Generate ANSI sample
git clone https://github.com/fcambus/ansilove
build/runphp tests/example_debug.php > example_debug
php ansilove/ansilove example_debug
git add example_debug.png
# Push new tests back to this branch
git commit -a -m "chore: auto generated tests / example png by github actions [ci skip]" || echo nothing to commit
# Update hash in HandlebarsTest and push back, trigger new tests there.
git clone https://github.com/zordius/HandlebarsTest
cd HandlebarsTest
echo ${GITHUB_SHA} > lightncandy
git add lightncandy
git commit -a -m "chore: auto test on zordius/lightncandy@${GITHUB_SHA}"
git push "https://${GHTK}@github.com/zordius/HandlebarsTest.git" > /dev/null 2>&1
cd ..
# Generate documents for this branch
build/gen_doc
if [ -z "${GITHUB_HEAD_REF}" ]; then
echo "Document will be pushed here: http://zordius.github.io/lightncandy/"
else
echo "Document will be pushed here: http://zordius.github.io/lightncandy/${BRANCH}/"
fi
git add docs
git commit -m "chore: auto generated documents from branch ${BRANCH} @${GITHUB_SHA} [ci skip]" || echo nothing new to be git commited
git --no-pager log -n 3
git push --quiet "https://${GHTK}@github.com/zordius/lightncandy.git" HEAD:${BRANCH} > /dev/null 2>&1 || echo nothing new to be git pushed.