-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (39 loc) · 1.15 KB
/
checkapproval.yml
File metadata and controls
40 lines (39 loc) · 1.15 KB
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
name: Trigger jenkins job
on:
workflow_call:
inputs:
PR_EVENT:
required: true
type: string
PR_URL:
required: true
type: string
TOKEN:
# default: 'checkapproval'
required: true
type: string
secrets:
JENKINS_WEB_HOOK:
required: true
permissions: read-all
jobs:
trigger-jenkins-with-prinfo:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: echo vars
run:
echo The PR_EVENT is ${{ inputs.PR_EVENT }}
echo The PR_URL is ${{ inputs.PR_URL }}
echo The TOKEN is ${{ inputs.TOKEN }}
- name: Trigger Jenkins Build with PR Information
run: |-
curl --location --request POST ${{ secrets.JENKINS_WEB_HOOK }}${{ inputs.TOKEN }} \
--header 'Content-Type: application/json' \
--data-raw '{
"action": ${{ inputs.PR_EVENT }} ,
"pull_request": {
"html_url": ${{ inputs.PR_URL }}
}
}'