-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
30 lines (28 loc) · 1.11 KB
/
Jenkinsfile
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
pipeline {
agent any
environment {
accessToken = ''
}
stages {
stage('Invoke GitHub Actions Workflow and Get Result') {
steps {
script {
try {
println("Step 1: Trigger the Workflow")
def curlCommand1 = """
curl --location "https://api.github.com/repos/Marrkkov/wdio-test-abstracta/actions/workflows/run_tests.yaml/dispatches"\
--header "Accept: application/vnd.github+json"\
--header "Authorization: Bearer ${accessToken}"\
--header "Content-Type: application/json"\
--data @payload.json
"""
bat(curlCommand1)
} catch (Exception e) {
echo "Failed to invoke GitHub Actions Workflow or retrieve results: ${e.getMessage()}"
currentBuild.result = 'FAILURE'
}
}
}
}
}
}