-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
58 lines (55 loc) · 2.18 KB
/
action.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
53
54
55
56
57
58
name: 'Run CD/RO pipeline'
description: Start a pipeline on a remote CloudBees CD/RO instance
branding:
icon: 'command'
color: 'blue'
inputs:
projectName:
description: Name of the project containing the pipeline
required: true
pipelineName:
description: Name of the pipeline to run
required: true
actualParameter:
description: Actual parameters to pass to the pipeline
required: false
ignore-unverified-cert:
description: Ignore unverified SSL certificate errors when connecting to CloudBees CD/RO instance
default: 'false'
required: false
runs:
using: "composite"
steps:
- name: runPipeline API
id: run-pipeline
uses: cloudbees-github-actions/eval-dsl@v1
with:
dsl: runPipeline args
dsl-args: |
projectName: ${{ inputs.projectName }}
pipelineName: ${{ inputs.pipelineName }}
dsl-actual-parameter: ${{ inputs.actualParameter }}
ignore-unverified-cert: ${{ inputs.ignore-unverified-cert }}
- name: Attach action meta data to runtime object
uses: cloudbees-github-actions/eval-dsl@v1
with:
dsl: |
def flowRuntimeId = "${{ fromJson(steps.run-pipeline.outputs.response).flowRuntime.flowRuntimeId }}"
def repository = "${{ github.repository }}"
def run_id = "${{ github.run_id }}"
setProperty flowRuntimeId: flowRuntimeId,
propertyName: "GitHub Actions Workflow URL",
value: "https://github.com/${repository}/actions/runs/${run_id}"
def firstStageRuntime
getPipelineRuntimeDetails(flowRuntimeId : flowRuntimeId)?[0]?.stageRuntimeDetails.any {
if (it.flowRuntimeId) {
firstStageRuntime=it.flowRuntimeId
return
}
}
if (firstStageRuntime) {
setProperty(flowRuntimeId:firstStageRuntime,
propertyName: "ec_summary/GitHub Workflow Run",
value: "<html><a href='"+"https://github.com/${repository}/actions/runs/${run_id}"+"'>link</a></html>")
}
ignore-unverified-cert: ${{ inputs.ignore-unverified-cert }}