Skip to content

Commit cbaaa06

Browse files
committed
trigger job using l0-test.yml
1 parent 708fb72 commit cbaaa06

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/l0-test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# A workflow to trigger ci on hybrid infra (github + self hosted runner)
1717
name: L0-Test
1818
on:
19+
issue_comment:
20+
types: [created]
1921
workflow_dispatch:
2022
inputs:
2123
sha:
@@ -31,6 +33,23 @@ on:
3133
description: 'test results page url'
3234
required: false
3335
jobs:
36+
Job-trigger:
37+
name: Start ci job
38+
if: startsWith( github.event.comment.body, '/bot' )
39+
runs-on: [self-hosted, Linux, Jenkins]
40+
steps:
41+
- name: Start ci job
42+
env:
43+
githubData: ${{ toJSON(github.event) }}
44+
run: |
45+
CI_SERVER="${{ secrets.CI_SERVER }}"
46+
JENKINS_URL=$(echo "$CI_SERVER" | cut -d '@' -f 1)
47+
TOKEN=$(echo "$CI_SERVER" | cut -d '@' -f 2)
48+
printf '%s' "$githubData" > githubData.json
49+
curl -s -X POST --fail-with-body \
50+
-H "Content-Type: application/json" \
51+
-d @githubData.json \
52+
"$JENKINS_URL/generic-webhook-trigger/invoke?token=$TOKEN"
3453
Upload-Test:
3554
name: Upload test results
3655
runs-on: linux-amd64-cpu4

0 commit comments

Comments
 (0)