forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 2
132 lines (121 loc) · 4.3 KB
/
_start.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Workflow start
# This workflow is only required for externally triggered jobs that need to manually
# set the check status for a commit/PR
permissions:
contents: read
on:
workflow_call:
secrets:
app-id:
required: true
app-key:
required: true
inputs:
details-url:
type: string
default: >-
https://github.com/envoyproxy/envoy/tree/main/.github/workflows
env:
type: string
required: true
run-summary:
type: string
default: >-
The check will start once any required jobs have completed and a VM becomes available
run-title:
type: string
default: >-
Waiting for check ...
skipped-summary:
type: string
default: >-
This check was not triggered in this CI run
skipped-title:
type: string
default: >-
Check was skipped
template-run-text:
type: string
default: |
## \($icon) Check run pending
## Details of the check run will be provided here once it has started.
### Check started by
env:
CI_DEBUG: ${{ (vars.CI_DEBUG || vars.RUNNER_DEBUG) && true || false }}
jobs:
start:
runs-on: ubuntu-22.04
steps:
- uses: envoyproxy/toolshed/gh-actions/jq@680d414be3f56cbb161dfdebebece85d81c3f686 # actions-v0.2.24
id: check-config
name: Prepare check data
with:
print-result: ${{ fromJSON(env.CI_DEBUG || 'false') && true || false }}
input: ${{ inputs.env }}
filter: |
. as $env
| .config.envoy.icon as $icon
| {}
| .["head_sha"] = $env.request.sha
| .details_url = "${{ inputs.details-url }}"
| {run: ., skipped: ., request: $env.summary.summary}
| .run.output.title = "${{ inputs.run-title }}"
| .run.output.summary = "${{ inputs.run-summary }}"
| .run.output.text = "${{ inputs.template-run-text }}"
| .run.status = "queued"
| .skipped.status = "completed"
| .skipped.conclusion = "skipped"
| .skipped.output.title = "${{ inputs.skipped-title }}"
| .skipped.output.summary = "${{ inputs.skipped-summary }}"
| .skipped.output.text = ""
- uses: envoyproxy/toolshed/gh-actions/appauth@680d414be3f56cbb161dfdebebece85d81c3f686 # actions-v0.2.24
name: Appauth
id: appauth
with:
app_id: ${{ secrets.app-id }}
key: ${{ secrets.app-key }}
- uses: envoyproxy/toolshed/gh-actions/github/checks@680d414be3f56cbb161dfdebebece85d81c3f686 # actions-v0.2.24
name: Start checks
id: checks
with:
checks: ${{ toJSON(fromJSON(inputs.env).checks) }}
config: ${{ steps.check-config.outputs.value }}
text-extra: |
## ${{ fromJSON(inputs.env).summary.linked-title }}
${{ fromJSON(inputs.env).summary.summary }}
token: ${{ steps.appauth.outputs.token }}
- uses: envoyproxy/toolshed/gh-actions/json/table@680d414be3f56cbb161dfdebebece85d81c3f686 # actions-v0.2.24
name: Summary
with:
collapse-open: true
json: |
{"checks": ${{ steps.checks.outputs.checks }},
"config": ${{ toJSON(fromJSON(inputs.env).checks) }}}
filter: |
.checks
heading: >-
${{ fromJSON(inputs.env).config.envoy.icon }} Checks
mutate-cells: |
.cell as $cell
| .row as $row
| .table as $table
| $cell
| if ($row | index($cell) == 0) then
$table.data.config[$cell].name
elif ($table.data.config[$row[0]].action != "SKIP") then
"[started](http://github.com/${{ github.repository }}/runs/\($cell))"
else "skipped" end
output-path: GITHUB_STEP_SUMMARY
title: Checks started/skipped
- uses: envoyproxy/toolshed/gh-actions/github/env/save@680d414be3f56cbb161dfdebebece85d81c3f686 # actions-v0.2.24
name: Save env
id: data
with:
env: ${{ inputs.env }}
env-filter: |
${{ steps.checks.outputs.checks }} as $checksStarted
| .checks
|= with_entries(
if $checksStarted[.key] != "skipped" then
.value["check-id"] = $checksStarted[.key]
else . end)