-
Notifications
You must be signed in to change notification settings - Fork 599
545 lines (482 loc) · 25.8 KB
/
operator_ci.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
name: Operator CI
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review, unlabeled]
env:
AUTOMERGE_ENABLED: "1"
OPP_PRODUCTION_TYPE: "k8s"
OPP_SCRIPT_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp.sh"
OPP_SCRIPT_ENV_OPRT_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-oprt.sh"
OPP_SCRIPT_ENV_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-env.sh"
OPP_SCRIPT_COSMETICS_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-oprt-cosmetics.sh"
OPP_THIS_REPO_BASE: "https://github.com"
OPP_THIS_REPO: "k8s-operatorhub/community-operators"
OPP_THIS_BRANCH: "main"
OPP_ANSIBLE_PULL_REPO: "https://github.com/redhat-openshift-ecosystem/operator-test-playbooks"
OPP_ANSIBLE_PULL_BRANCH: "upstream-community"
OPP_REVIEWERS_ENABLED: 1
OPP_THIS_REPO_NAME: "community-operators"
OPP_THIS_REPO_ORG: "k8s-operatorhub"
jobs:
operator-automerge-enabled:
runs-on: ubuntu-latest
if: github.event.pull_request.state == 'open'
steps:
- name: Remove automerge-disabled when needed
if: ${{ env.AUTOMERGE_ENABLED == '1' }}
uses: actions/github-script@v6
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'automerge-disabled'
})
- name: Add automerge-disabled when needed
uses: actions/github-script@v6
if: ${{ env.AUTOMERGE_ENABLED == '0' }}
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'automerge-disabled' ]
})
operator-ci:
if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'allow/test-in-draft-mode')
needs: operator-automerge-enabled
runs-on: ubuntu-latest
steps:
# - name: Setting labels from changes in directory changes
# uses: actions/labeler@v2
# with:
# repo-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Remove package-validated"
uses: actions/github-script@v6
if: (!contains(github.event.pull_request.labels.*.name, 'do-not-merge/hold'))
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'package-validated'
})
- name: "Add Assignees"
uses: actions/github-script@v6
if: github.event.action == 'opened' || github.event.action == 'reopened'
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['mporrato', 'Allda']
});
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip yq
- name: Operator traffic light
id: op-traffic-light
env:
OPP_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}"
OPP_PR_AUTHOR: "${{ github.event.pull_request.user.login }}"
OPP_OPRT_REPO: "${{ github.event.pull_request.head.repo.full_name }}"
OPP_OPRT_SHA: "${{ github.event.pull_request.head.sha }}"
OPP_OPRT_SRC_REPO: "${{ github.event.pull_request.base.repo.full_name }}"
OPP_OPRT_SRC_BRANCH: "${{ github.event.pull_request.base.ref }}"
OPP_THIS_PR: ${{ github.event.pull_request.number }}
run: |
bash <(curl -sL $OPP_SCRIPT_ENV_OPRT_URL)
- name: "Remove installation-validated"
uses: actions/github-script@v6
if: (github.event.action != 'unlabeled')
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const arr = ['installation-validated', 'installation-validated-atest', ];
for (let label of arr) {
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: label
})
}
- name: "Mention reviewers if exist"
if: (steps.op-traffic-light.outputs.opp_pr_revievers != '') && (!contains(github.event.pull_request.labels.*.name, 'allow/ci-changes'))
uses: mshick/add-pr-comment@v1
with:
message: |
${{ steps.op-traffic-light.outputs.opp_pr_revievers }}, please approve as you are original reviewer(s).
- To add more contributors to `ci.yaml` follow instruction [here](https://${OPP_THIS_REPO_ORG}.github.io/${OPP_THIS_REPO_NAME}/operator-ci-yaml).
- To approve follow instruction [here](https://${OPP_THIS_REPO_ORG}.github.io/${OPP_THIS_REPO_NAME}/self-merge-updates/#how-can-i-approve-a-pr-against-my-operator)
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: false
- name: "Mention reviewers if ci.yaml was changed"
if: steps.op-traffic-light.outputs.opp_pr_revievers != '' && steps.op-traffic-light.outputs.opp_ci_yaml_changed == '1' && steps.op-traffic-light.outputs.opp_authorized_changes == '0'
uses: mshick/add-pr-comment@v1
with:
message: |
/hold
${{ steps.op-traffic-light.outputs.opp_pr_revievers }}, Please note that ci.yml was changed.
- To approve follow instruction [here](https://${OPP_THIS_REPO_ORG}.github.io/${OPP_THIS_REPO_NAME}/self-merge-updates/#how-can-i-approve-a-pr-against-my-operator)
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: false
- name: "Comment operator test error code [1]"
if: failure() && steps.op-traffic-light.outputs.opp_error_code == '1'
uses: mshick/add-pr-comment@v1
with:
message: |
Overwrite and recreate labels cannot be set at the same time.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: "Comment operator test error code [2]"
if: failure() && steps.op-traffic-light.outputs.opp_error_code == '2'
uses: mshick/add-pr-comment@v1
with:
message: |
/hold
There are changes in both `community-operators` and `upstream-community-operators` directories at the same time. Only one of these directories can be changed in one PR. You need to open another PR for other directory (e.g. `upstream-community-operators`)
Please add comment with `/hold cancel` when ready.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: "Comment operator test error code [3]"
if: failure() && steps.op-traffic-light.outputs.opp_error_code == '3'
uses: mshick/add-pr-comment@v1
with:
message: |
This PR has changes outside of `operators` directory. Maintainers have to approve it.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: "Comment operator test error code [4]"
if: failure() && steps.op-traffic-light.outputs.opp_error_code == '4'
uses: mshick/add-pr-comment@v1
with:
message: |
/hold
File `${{ steps.op-traffic-light.outputs.opp_production_type }}/${{ steps.op-traffic-light.outputs.opp_name }}/ci.yaml` is missing or not valid. More details in failed test `Operator CI / operator-ci` logs. Documentation how to setup valid `ci.yaml` file can be found at https://${OPP_THIS_REPO_ORG}.github.io/${OPP_THIS_REPO_NAME}/operator-ci-yaml."
Note: Only single file modification on `ci.yaml` is allowed. Please make separate PR to apply `ci.yaml` file updates and get it merged before current PR.
Please add comment with `/hold cancel` when ready.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: "Comment operator test error code [5]"
if: failure() && steps.op-traffic-light.outputs.opp_error_code == '5'
uses: mshick/add-pr-comment@v1
with:
message: |
/hold
Multiple opratros changes are not supported in single PR. Please open another PRs for other operators.
Please add comment with `/hold cancel` when ready.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
# Please make it automatic (so we set recreate label)
- name: "Comment operator test error code [6]"
if: failure() && steps.op-traffic-light.outputs.opp_error_code == '6'
uses: mshick/add-pr-comment@v1
with:
message: |
/hold
Old version were changed/removed and 'allow/operator-recreate' is not set.
Please add comment with `/hold cancel` when ready.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: "Comment operator test error code [7]"
if: failure() && steps.op-traffic-light.outputs.opp_error_code == '7'
uses: mshick/add-pr-comment@v1
with:
message: |
/hold
Only single file modification on `ci.yaml` is allowed. Please make separate PR to apply `ci.yaml` file updates and get it merged before current PR.
Please add comment with `/hold cancel` when ready.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: "Comment operator test error code [7]"
if: steps.op-traffic-light.outputs.opp_dockerfile_changed == '1'
uses: mshick/add-pr-comment@v1
with:
message: |
`Dockerfile` or `bundle.Dockerfile` is added/changed. Note that for security reasons none of these files are going to be used when building bundle. Docker file will be generated and all label information is taken from `annotations.yaml`.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: Update title
uses: actions/github-script@v6
continue-on-error: true
if: always() && steps.op-traffic-light.outputs.opp_pr_title != ''
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
title: "${{ steps.op-traffic-light.outputs.opp_pr_title }}"
})
- name: Handle new operator
uses: actions/github-script@v6
if: steps.op-traffic-light.outputs.opp_is_new_operatror == '1'
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'new-operator' ]
})
- name: Verify operator modifications
id: op-verify-modifications
env:
OPP_RECREATE: "${{ steps.op-traffic-light.outputs.opp_recreate }}"
OPP_ALLOW_SERIOUS_CHANGES: "${{ steps.op-traffic-light.outputs.opp_allow_serious_changes }}"
OPP_MODIFIED_CSVS: "${{ steps.op-traffic-light.outputs.opp_modified_csvs }}"
OPP_MODIFIED_CSVS_OTHERS: "${{ steps.op-traffic-light.outputs.opp_modified_others }}"
run: |
echo "opp_check_cosmetic=0" >> $GITHUB_OUTPUT
[[ $OPP_RECREATE -eq 1 ]] && { echo "Recreating operator. Exiting with '0' ..."; exit 0; } || true
[[ $OPP_ALLOW_SERIOUS_CHANGES -eq 1 ]] && { echo "Allowing serious changes. Exiting with '0' ..."; exit 0; } || true
[ -n "$OPP_MODIFIED_CSVS" ] && echo "opp_check_cosmetic=1" >> $GITHUB_OUTPUT || true
[ -n "$OPP_MODIFIED_CSVS_OTHERS" ] && { echo -e "Error:\n Modifying exiting operator version !!!\n Only cosmetic changes are allowed !!! Please ask maintainers to set 'allow/serious-changes-to-existing' label.\n Files that cannot be changed : '$OPP_MODIFIED_CSVS_OTHERS'"; echo "opp_check_cosmetic=2" >> $GITHUB_OUTPUT; exit 20; } || true
- name: "Comment for cosmetics change error when csv is changed"
if: failure() && steps.op-verify-modifications.outputs.opp_check_cosmetic == '2'
uses: mshick/add-pr-comment@v1
with:
message: |
/hold
Only minor (cosmetic) changes to already published operator version(s) are allowed. Consider bumping your operator version. In exceptional cases, it could be overridden by setting `allow/serious-changes-to-existing` label set by maintainers and then confirmed action by running command `/hold cancel`.
<details>
Reason: Non CSV files were changed in existing operator !!!
More info about allowed changes can be found in [documetnation](https://${OPP_THIS_REPO_ORG}.github.io/${OPP_THIS_REPO_NAME}/operator-version-update/#minor-cosmetics-changes).
</details>
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: Operator cosmetic change check
id: op-cosmetic-change-check
if: steps.op-verify-modifications.outputs.opp_check_cosmetic == '1'
env:
OPP_MODIFIED_CSVS: "${{ steps.op-traffic-light.outputs.opp_modified_csvs }}"
OPP_MODIFIED_REPO_BRANCH: "${{ steps.op-traffic-light.outputs.opp_repo_branch }}"
run: |
echo "OPP_MODIFIED_CSVS=$OPP_MODIFIED_CSVS"
echo "opp_check_cosmetic: ${{ steps.op-verify-modifications.outputs.opp_check_cosmetic }}"
echo "opp_set_label_operator_version_overwrite: ${{ steps.op-traffic-light.outputs.opp_set_label_operator_version_overwrite }}"
echo "opp_set_label_operator_recreate: ${{ steps.op-traffic-light.outputs.opp_set_label_operator_recreate }}"
bash <(curl -sL $OPP_SCRIPT_COSMETICS_URL)
echo "DONE"
- name: "Comment for cosmetics change error"
if: failure() && steps.op-verify-modifications.outputs.opp_check_cosmetic == '1'
uses: mshick/add-pr-comment@v1
with:
message: |
/hold
Only minor (cosmetic) changes to already published operator version(s) are allowed. Consider bumping your operator version. In exceptional cases, it could be overridden by setting `allow/serious-changes-to-existing` label set by maintainers and then confirmed action by running command `/hold cancel`.
<details>
More info about allowed changes can be found in [documetnation](https://${OPP_THIS_REPO_ORG}.github.io/${OPP_THIS_REPO_NAME}/troubleshooting/#minor-changes).
</details>
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: "Removing Operator recreate label when exists"
uses: actions/github-script@v6
if: steps.op-traffic-light.outputs.opp_set_label_operator_version_overwrite == '1' && contains(github.event.pull_request.labels.*.name, 'allow/operator-recreate')
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'allow/operator-recreate'
})
- name: "Setting Operator version overwrite label"
uses: actions/github-script@v6
if: steps.op-traffic-light.outputs.opp_set_label_operator_version_overwrite == '1'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'allow/operator-version-overwrite' ]
})
- name: "Removing Operator version overwrite label when exists"
uses: actions/github-script@v6
if: steps.op-traffic-light.outputs.opp_set_label_operator_recreate == '1' && contains(github.event.pull_request.labels.*.name, 'allow/operator-version-overwrite')
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'allow/operator-version-overwrite'
})
- name: "Setting Operator recreate label"
uses: actions/github-script@v6
if: steps.op-traffic-light.outputs.opp_set_label_operator_recreate == '1'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'allow/operator-recreate' ]
})
- name: "Inform user that UpdateGraph is not present (semver mode)"
uses: mshick/add-pr-comment@v1
continue-on-error: true
if: steps.op-traffic-light.outputs.opp_update_graph == '0'
with:
message: |
Warning: Operator is going to run in `semver-mode` since 'updateGraph' is not present in 'ci.yaml' file.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
# - name: Setup reviewers
# uses: kentaro-m/[email protected]
# continue-on-error: true
# with:
# configuration-path: "${{steps.op-traffic-light.outputs.opp_production_type }}/${{ steps.op-traffic-light.outputs.opp_name }}/ci.yaml"
- name: "Setting authorized-changes label"
uses: actions/github-script@v6
if: steps.op-traffic-light.outputs.opp_authorized_changes == '1'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'authorized-changes' ]
})
# - name: "Setting msg when minor changes are allowed"
# if: steps.op-verify-modifications.outputs.opp_check_cosmetic == '1' && ! contains(github.event.pull_request.labels.*.name, 'allow/operator-version-overwrite') && ! contains(github.event.pull_request.labels.*.name, 'allow/operator-recreate')
# uses: mshick/add-pr-comment@v1
# with:
# message: |
# /hold
# Minor (cosmetic) changes to already published operator version(s) were detected.
# Please confirm by posting `/unhold` command or removing `do-not-merge/hold ` label.
# <details>
# One or multiple versions were modified with minor (cosmetic) changes.
# </details>
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
# allow-repeats: true
- name: Info
run: |
echo "steps.op-traffic-light.outputs.opp_test_ready: ${{ steps.op-traffic-light.outputs.opp_test_ready }}"
echo "steps.op-traffic-light.outputs.opp_release_ready: ${{ steps.op-traffic-light.outputs.opp_release_ready }}"
echo "steps.op-traffic-light.outputs.opp_production_type: ${{ steps.op-traffic-light.outputs.opp_production_type }}"
echo "steps.op-traffic-light.outputs.opp_name: ${{ steps.op-traffic-light.outputs.opp_name }}"
echo "steps.op-traffic-light.outputs.opp_version: ${{ steps.op-traffic-light.outputs.opp_version }}"
echo "steps.op-traffic-light.outputs.opp_ci_yaml_only: ${{ steps.op-traffic-light.outputs.opp_ci_yaml_only }}"
echo "steps.op-traffic-light.outputs.opp_installation_skipped: ${{ steps.op-traffic-light.outputs.opp_installation_skipped }}"
outputs:
opp_test_ready: "${{ steps.op-traffic-light.outputs.opp_test_ready }}"
opp_release_ready: "${{ steps.op-traffic-light.outputs.opp_release_ready }}"
opp_production_type: "${{ steps.op-traffic-light.outputs.opp_production_type }}"
opp_name: "${{ steps.op-traffic-light.outputs.opp_name }}"
opp_version: "${{ steps.op-traffic-light.outputs.opp_version }}"
opp_ci_yaml_only: "${{ steps.op-traffic-light.outputs.opp_ci_yaml_only }}"
opp_installation_skipped: "${{ steps.op-traffic-light.outputs.opp_installation_skipped }}"
operator-ci-ok-to-test:
needs: operator-ci
runs-on: ubuntu-latest
steps:
- name: "Remove needs-ok-to-test"
uses: actions/github-script@v6
if: always()
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'needs-ok-to-test'
})
- name: Info
run: |
echo "needs.operator-ci.outputs.opp_production_type: ${{ needs.operator-ci.outputs.opp_production_type }}"
echo "needs.operator-ci.outputs.opp_ci_yaml_only: ${{ needs.operator-ci.outputs.opp_ci_yaml_only }}"
echo "needs.operator-ci.outputs.opp_installation_skipped: ${{ needs.operator-ci.outputs.opp_installation_skipped }}"
- name: "Setting ok-to-test label"
uses: actions/github-script@v6
if: needs.operator-ci.outputs.opp_production_type != 'k8s' && needs.operator-ci.outputs.opp_ci_yaml_only != '1' && (!contains(github.event.pull_request.labels.*.name, 'allow/ci-changes')) && needs.operator-ci.outputs.opp_installation_skipped == '0'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'ok-to-test' ]
})
- name: "Setting installation-validated label (opensift+ci_yaml_only)"
uses: actions/github-script@v6
if: needs.operator-ci.outputs.opp_production_type != 'k8s' && needs.operator-ci.outputs.opp_ci_yaml_only == '1'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'installation-validated' ]
})
- name: "Setting installation-validated label (when installation_skipped)"
uses: actions/github-script@v6
if: needs.operator-ci.outputs.opp_installation_skipped == '1'
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'installation-validated', 'installation-skipped' ]
})
- name: Try to automerge
uses: actions/github-script@v6
if: needs.operator-ci.outputs.opp_production_type != 'k8s' && needs.operator-ci.outputs.opp_ci_yaml_only == '1'
continue-on-error: true
with:
github-token: ${{ secrets.FRAMEWORK_MERGE }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '/merge possible'
})