-
Notifications
You must be signed in to change notification settings - Fork 9.1k
52 lines (43 loc) · 1.51 KB
/
jenkins_test.yaml
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
name: Get Commit Status on PR
on:
pull_request:
types: [opened, synchronize]
jobs:
test-jenkins:
strategy:
matrix:
run_id: [1, 2]
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Push to tmp-jenkins branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b __jenkins_test_run_${{ matrix.run_id }}
echo "TEST JENKINS ${{ matrix.run_id }}" >> test_file
git add test_file
git commit -m "test run ${{ matrix.run_id }}"
GIT_LFS_SKIP_PUSH=1 git push -f origin __jenkins_test_run_${{ matrix.run_id }}
- name: Get Commit Status
uses: actions/github-script@v6
with:
script: |
let prev_status = false;
setInterval(() => {
const response = github.request('GET /repos/{owner}/{repo}/commits/{ref}/status', {
owner: 'commaai',
repo: 'openpilot',
ref: 'heads/__jenkins_test_run_${{ matrix.run_id }}',
headers: {
'Accept': 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28'
}
});
response.then(function(r) {
console.log('in promise');
console.log(r.data.statuses);
});
console.log('in the loop');
}, 10000);