-
Notifications
You must be signed in to change notification settings - Fork 294
51 lines (48 loc) · 1.47 KB
/
push_tip_to_trybot.yml
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
# Code generated internal/ci/ci_tool.cue; DO NOT EDIT.
name: Push tip to trybot
"on":
push:
branches:
- master
- release-branch.*
concurrency: push_tip_to_trybot
jobs:
push:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
if: ${{github.repository == 'cue-lang/cue'}}
steps:
- name: Write netrc file for cueckoo Gerrithub
run: |-
cat <<EOD > ~/.netrc
machine review.gerrithub.io
login cueckoo
password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}
EOD
chmod 600 ~/.netrc
- name: Push tip to trybot
run: |-
mkdir tmpgit
cd tmpgit
git init -b initialbranch
git config user.name cueckoo
git config user.email [email protected]
git config http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)"
git remote add origin https://review.gerrithub.io/a/cue-lang/cue
git remote add trybot https://github.com/cue-lang/cue-trybot
git fetch origin "${{ github.ref }}"
success=false
for try in {1..20}; do
echo "Push to trybot try $try"
if git push -f trybot "FETCH_HEAD:${{ github.ref }}"; then
success=true
break
fi
sleep 1
done
if ! $success; then
echo "Giving up"
exit 1
fi